Package java.io
Class PrintStream
void write(byte[] buf, int offset, int len)
Overrides:
void write(int b)
Overrides:
_INSERT_METHOD_SIGNATURE_HERE_
Description:
write(byte[] buf, int offset, int len) method:
Writes len bytes from buf, starting at offset offset to this stream. If automatic flushing is enabled then the flush method is called. The bytes will be written without additional encoding.
write(int b) method:
Writes the specified byte to this stream. If the byte is a newline and automatic flushing is enabled the flush method will be called. The bytes will be written without additional encoding.
File file = new File("testFile");
int fileInt = 100;
OutputStream fos = new FileOutputStream(file);
PrintStream ps = new PrintStream(fos);
...
ps.write(fileInt);
The example above prints the specified character to the file.