Package com.google.common.io


This package contains utility methods and classes for working with Java I/O; for example input streams, output streams, readers, writers, and files.

At the core of this package are the Source/Sink types: ByteSource, CharSource, ByteSink and CharSink. They are factories for I/O streams that provide many convenience methods that handle both opening and closing streams for you.

This package is a part of the open-source Guava library. For more information on Sources and Sinks as well as other features of this package, see I/O Explained on the Guava wiki.

  • Class
    Description
    A binary encoding scheme for reversibly translating between byte sequences and printable ASCII strings.
    Exception indicating invalid base-encoded input encountered while decoding.
    An extension of DataInput for reading from in-memory byte arrays; its methods offer identical functionality but do not throw IOException.
    An extension of DataOutput for writing to in-memory byte arrays; its methods offer identical functionality but do not throw IOException.
    A callback interface to process bytes from a stream.
    A destination to which bytes can be written, such as a file.
    A readable source of bytes, such as a file.
    Provides utility methods for working with byte arrays and I/O streams.
    A destination to which characters can be written, such as a text file.
    A readable source of characters, such as a text file.
    Provides utility methods for working with character streams.
    Utility methods for working with Closeable objects.
    A Closeable that collects Closeable resources and closes them all when it is closed.
    An InputStream that counts the number of bytes read.
    An OutputStream that counts the number of bytes written.
    An OutputStream that starts buffering to a byte array, but switches to file buffering once the data reaches a configurable size.
    Provides utility methods for working with files.
    Modes for opening a file for writing.
    Utility methods for working with Flushable objects.
    A callback to be used with the streaming readLines methods.
    A class for reading lines of text.
    An implementation of DataInput that uses little-endian byte ordering for reading short, int, float, double, and long values.
    An implementation of DataOutput that uses little-endian byte ordering for writing char, short, int, float, double, and long values.
    File name filter that only accepts files matching a regular expression.
    Provides utility methods for working with resources in the classpath.