Package com.google.common.io
@ParametersAreNonnullByDefault
package com.google.common.io
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.
-
ClassDescriptionWriter that places all output on an
Appendable
target.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 ofDataInput
for reading from in-memory byte arrays; its methods offer identical functionality but do not throwIOException
.An extension ofDataOutput
for writing to in-memory byte arrays; its methods offer identical functionality but do not throwIOException
.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.AReader
that reads the characters in aCharSequence
.A destination to which characters can be written, such as a text file.A readable source of characters, such as a text file.Subclass specialized for string instances.Provides utility methods for working with character streams.Utility methods for working withCloseable
objects.Suppression strategy interface.AnInputStream
that counts the number of bytes read.An OutputStream that counts the number of bytes written.Marks all "top-level" types as non-null in a way that is recognized by Kotlin.AnOutputStream
that starts buffering to a byte array, but switches to file buffering once the data reaches a configurable size.ByteArrayOutputStream that exposes its internals.Provides utility methods for working with files.Modes for opening a file for writing.Utility methods for working withFlushable
objects.Disables Animal Sniffer's checking of compatibility with older versions of Java/Android.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).Wrappers aroundBuffer
methods that are covariantly overridden in Java 9+.Package-protected abstract class that implements the line reading algorithm used byLineReader
.A callback to be used with the streamingreadLines
methods.A class for reading lines of text.An implementation ofDataInput
that uses little-endian byte ordering for readingshort
,int
,float
,double
, andlong
values.An implementation ofDataOutput
that uses little-endian byte ordering for writingchar
,short
,int
,float
,double
, andlong
values.AnInputStream
that concatenates multiple substreams.AReader
that concatenates multiple readers.Annotates a "top-level" type-variable usage that takes its nullness from the type argument supplied by the user of the class.File name filter that only accepts files matching a regular expression.AnInputStream
that converts characters from aReader
into bytes using an arbitrary Charset.Options for use with recursive delete methods (MoreFiles.deleteRecursively(java.nio.file.Path, com.google.common.io.RecursiveDeleteOption...)
andMoreFiles.deleteDirectoryContents(java.nio.file.Path, com.google.common.io.RecursiveDeleteOption...)
).Provides utility methods for working with resources in the classpath.A byte source that reads from a URL usingURL.openStream()
.Creates temporary files and directories whose permissions are restricted to the current user or, in the case of Android, the current app.