Package-level declarations
Types
This timeout uses a background thread to take action exactly when the timeout occurs. Use this to implement timeouts where they aren't supported natively, such as to sockets that are blocked on writing.
A collection of bytes in memory.
A sink that keeps a buffer internally so that callers can do small writes without a performance penalty.
A source that keeps a buffer internally so that callers can do small reads without a performance penalty. It also allows clients to read ahead, buffering as much as necessary before consuming input.
An immutable sequence of bytes.
A sink that uses DEFLATE to compress data written to another source.
An open file for reading and writing; using either streaming and random access.
Description of a file or another object referenced by a path.
Read and write access to a hierarchical collection of files, addressed by paths. This is a natural interface to the current computer's local file system.
A FileSystem that forwards calls to another, intended for subclassing.
A Sink which forwards calls to another. Useful for subclassing.
A Timeout which forwards calls to another. Useful for subclassing.
A source that uses GZIP to decompress data read from another source.
A sink that computes a hash of the full stream of bytes it has accepted. To use, create an instance with your preferred hash algorithm. Write all of the data to the sink and then call hash to compute the final hash value.
A sink that computes a hash of the full stream of bytes it has accepted. To use, create an instance with your preferred hash algorithm. Write all of the data to the sink and then call hash to compute the final hash value.
A source that computes a hash of the full stream of bytes it has supplied. To use, create an instance with your preferred hash algorithm. Exhaust the source by reading all of its bytes and then call hash to compute the final hash value.
A source that computes a hash of the full stream of bytes it has supplied. To use, create an instance with your preferred hash algorithm. Exhaust the source by reading all of its bytes and then call hash to compute the final hash value.
A source that uses DEFLATE to decompress data read from another source.
An indexed set of values that may be read with BufferedSource.select.
A hierarchical address on a file system. A path is an identifier only; a FileSystem is required to access the file that a path refers to, if any.
Receives a stream of bytes. Use this interface to write data wherever it's needed: to the network, storage, or a buffer in memory. Sinks may be layered to transform received data, such as to compress, encrypt, throttle, or add protocol framing.
Enables limiting of Source and Sink throughput. Attach to this throttler via source and sink and set the desired throughput via bytesPerSecond. Multiple Sources and Sinks can be attached to a single Throttler and they will be throttled as a group, where their combined throughput will not exceed the desired throughput. The same Source or Sink can be attached to multiple Throttlers and its throughput will not exceed the desired throughput of any of the Throttlers.
A policy on how much time to spend on a task before giving up. When a task times out, it is left in an unspecified state and should be abandoned. For example, if reading from a source times out, that source should be closed and the read should be retried later. If writing to a sink times out, the same rules apply: close the sink and retry later.
A list of values that may be read with BufferedSource.select.
Properties
Functions
Returns a sink that writes to file
.
Returns a sink that writes nowhere.
Returns a new sink that buffers writes to sink
. The returned sink will batch writes to sink
. Use this wherever you write to a sink to get an ergonomic and efficient access to data.
Returns a new source that buffers reads from source
. The returned source will perform bulk reads into its in-memory buffer. Use this wherever you read a source to get an ergonomic and efficient access to data.
Returns a sink that uses cipher to encrypt or decrypt this.
Returns a source that uses cipher to encrypt or decrypt this.
Returns an DeflaterSink that DEFLATE-compresses data to this Sink while writing.
Returns an InflaterSource that DEFLATE-decompresses this Source while reading.
Copy count bytes from the memory at this pointer into a ByteString.
Returns a sink that writes to out
.
Returns a sink that writes to socket
. Prefer this over sink because this method honors timeouts. When the socket write times out, the socket is asynchronously closed by a watchdog thread.
Returns a sink that writes to file
.
Returns a sink that writes to path
.
Returns a source that reads from file
.
Returns a source that reads from in
.
Returns a source that reads from socket
. Prefer this over source because this method honors timeouts. When the socket read times out, the socket is asynchronously closed by a watchdog thread.
Returns a source that reads from path
.