Top Description Interfaces Annotations Classes Enums
[default module]

Package com.google.common.io

Annotations
@CheckReturnValue
@ParametersAreNonnullByDefault
Imports
com.google.errorprone.annotations.CheckReturnValue, javax.annotation.ParametersAreNonnullByDefault

Utility methods and classes for 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.

Author
Chris Nokleberg

Interface Summary

Modifier and TypeInterface and Description
public interface
ByteArrayDataInput

An extension of DataInput for reading from in-memory byte arrays; its methods offer identical functionality but do not throw IOException.

public interface
ByteArrayDataOutput

An extension of DataOutput for writing to in-memory byte arrays; its methods offer identical functionality but do not throw IOException.

public interface
ByteProcessor<T extends @Nullable Object>

A callback interface to process bytes from a stream.

public interface
LineProcessor<T extends @Nullable Object>

A callback to be used with the streaming readLines methods.

Annotation Summary

Modifier and TypeAnnotation and Description
pack-priv @interface
ElementTypesAreNonnullByDefault

Marks all "top-level" types as non-null in a way that is recognized by Kotlin.

pack-priv @interface
IgnoreJRERequirement

Disables Animal Sniffer's checking of compatibility with older versions of Java/Android.

pack-priv @interface
ParametricNullness

Annotates a "top-level" type-variable usage that takes its nullness from the type argument supplied by the user of the class.

Class Summary

Modifier and TypeClass and Description
pack-priv class
AppendableWriter

Writer that places all output on an Appendable target.

public abstract class
BaseEncoding

A binary encoding scheme for reversibly translating between byte sequences and printable ASCII strings.

public abstract class
ByteSink

A destination to which bytes can be written, such as a file.

public abstract class
ByteSource

A readable source of bytes, such as a file.

public class
ByteStreams

Provides utility methods for working with byte arrays and I/O streams.

pack-priv class
CharSequenceReader

A Reader that reads the characters in a CharSequence.

public abstract class
CharSink

A destination to which characters can be written, such as a text file.

public abstract class
CharSource

A readable source of characters, such as a text file.

public class
CharStreams

Provides utility methods for working with character streams.

public class
Closeables

Utility methods for working with Closeable objects.

public class
Closer

A Closeable that collects Closeable resources and closes them all when it is closed.

public class
CountingInputStream

An InputStream that counts the number of bytes read.

public class
CountingOutputStream

An OutputStream that counts the number of bytes written.

public class
FileBackedOutputStream

An OutputStream that starts buffering to a byte array, but switches to file buffering once the data reaches a configurable size.

public class
Files

Provides utility methods for working with files.

public class
Flushables

Utility methods for working with Flushable objects.

public class
InsecureRecursiveDeleteException

Exception indicating that a recursive delete can't be performed because the file system does not have the support necessary to guarantee that it is not vulnerable to race conditions that would allow it to delete files and directories outside of the directory being deleted (i.e., SecureDirectoryStream is not supported).

pack-priv class
Java8Compatibility

Wrappers around Buffer methods that are covariantly overridden in Java 9+.

pack-priv abstract class
LineBuffer

Package-protected abstract class that implements the line reading algorithm used by LineReader.

public class
LineReader

A class for reading lines of text.

public class
LittleEndianDataInputStream

An implementation of DataInput that uses little-endian byte ordering for reading short, int, float, double, and long values.

public class
LittleEndianDataOutputStream

An implementation of DataOutput that uses little-endian byte ordering for writing char, short, int, float, double, and long values.

public class
MoreFiles

Static utilities for use with Path instances, intended to complement Files.

pack-priv class
MultiInputStream

An InputStream that concatenates multiple substreams.

pack-priv class
MultiReader

A Reader that concatenates multiple readers.

public class
PatternFilenameFilter

File name filter that only accepts files matching a regular expression.

pack-priv class
ReaderInputStream

An InputStream that converts characters from a Reader into bytes using an arbitrary Charset.

public class
Resources

Provides utility methods for working with resources in the classpath.

pack-priv abstract class
TempFileCreator

Creates temporary files and directories whose permissions are restricted to the current user or, in the case of Android, the current app.

Enum Summary

Modifier and TypeEnum and Description
public enum
FileWriteMode

Modes for opening a file for writing.

public enum
RecursiveDeleteOption

Options for use with recursive delete methods (MoreFiles#deleteRecursively and MoreFiles#deleteDirectoryContents).