Java FileInputStream
Methods
FileInputStream Methods
The FileInputStream class provides methods to read data (as bytes) from a
file:
Method Description Return Type
available() Returns the number of bytes that can be int
read without blocking
close() Closes the stream and releases system void
resources
read() Reads one byte of data int
read() Reads bytes into an array (or part of an int
array)
skip() Skips over and discards n bytes of data long
getFD() Returns the file descriptor object FileDescriptor
associated with the stream
getChannel() Returns the unique FileChannel object FileChannel
for this stream
Related Pages
Java I/O Streams Tutorial
Java FileInputStream Tutorial
COLOR PICKER
REMOVE ADS
Java FileOutputStream
Methods
FileOutputStream Methods
The FileOutputStream class provides methods to write data (as bytes) to a
file:
Method Description Return Type
close() Closes the stream and releases system void
resources
flush() Flushes the stream - forces any buffered void
output bytes to be written immediately
write() Writes one byte, an array of bytes, or void
part of an array to the file
getFD() Returns the file descriptor object FileDescriptor
associated with the stream
getChannel() Returns the unique FileChannel object FileChannel
for this stream
Related Pages
Java BufferedReader
Methods
BufferedReader Methods
The BufferedReader class provides methods to read text efficiently:
Method Description Return Type
close() Closes the stream and releases system void
resources
mark() Marks the current position in the stream void
markSupporte Checks if mark() and reset() are boolean
d() supported
read() Reads a single character int
read() Reads characters into an array or a int
portion of an array
readLine() Reads one full line of text String
ready() Checks if the stream is ready to be read boolean
reset() Resets the stream to the last marked void
position
skip() Skips over characters in the stream long
lines() Returns a Stream<String> of all lines Stream<Strin
g>
transferTo() Reads all characters and writes them to long
the given writer
Related Pages
Java I/O Streams Tutorial
Java BufferedReader Tutorial
COLOR PICKER
REMOVE ADS