Many of the methods are based on the
OutputSupplier interfaces. They are used as
factories for I/O objects that might throw
being created. The advantage of using a factory is that the helper methods in
this package can take care of closing the resource properly, even if an
exception is thrown. The
Files classes all have static helper methods to
create new factories and to work with them.
This package is a part of the open-source Guava libraries.
Interface Summary Interface Description ByteArrayDataInputAn extension of
DataInputfor reading from in-memory byte arrays; its methods offer identical functionality but do not throw
ByteArrayDataOutputAn extension of
DataOutputfor writing to in-memory byte arrays; its methods offer identical functionality but do not throw
ByteProcessor<T>A callback interface to process bytes from a stream. InputSupplier<T>A factory for readable streams of bytes or characters. LineProcessor<T>A callback to be used with the streaming
OutputSupplier<T>A factory for writable streams of bytes or characters.
Class Summary Class Description BaseEncodingA binary encoding scheme for reversibly translating between byte sequences and printable ASCII strings. ByteSinkA destination to which bytes can be written, such as a file. ByteSourceA readable source of bytes, such as a file. ByteStreamsProvides utility methods for working with byte arrays and I/O streams. CharSinkA destination to which characters can be written, such as a text file. CharSourceA readable source of characters, such as a text file. CharStreamsProvides utility methods for working with character streams. CloseablesUtility methods for working with
InputStreamthat counts the number of bytes read.
CountingOutputStreamAn OutputStream that counts the number of bytes written. FileBackedOutputStreamAn
OutputStreamthat starts buffering to a byte array, but switches to file buffering once the data reaches a configurable size.
FilesProvides utility methods for working with files. FlushablesUtility methods for working with
LineReaderA class for reading lines of text. LittleEndianDataInputStreamAn implementation of
DataInputthat uses little-endian byte ordering for reading
LittleEndianDataOutputStreamAn implementation of
DataOutputthat uses little-endian byte ordering for writing
PatternFilenameFilterFile name filter that only accepts files matching a regular expression. ResourcesProvides utility methods for working with resources in the classpath.
Enum Summary Enum Description FileWriteModeModes for opening a file for writing.
Exception Summary Exception Description BaseEncoding.DecodingExceptionException indicating invalid base-encoded input encountered while decoding.