Top Description Methods
io.grpc

public Interface Drainable

Imports
java.io.IOException, .OutputStream

Extension to an java.io.InputStream or alike by adding a method that transfers all content to an OutputStream.

This can be used for optimizing for the case where the content of the input stream will be written to an OutputStream eventually. Instead of copying the content to a byte array through read(), then writing the OutputStream, the implementation can write the content directly to the OutputStream.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

number of bytes written.
drainTo
(OutputStream
to write to.
target
)

Transfers the entire contents of this stream to the specified target.

Method Detail

drainToback to summary
public int drainTo(OutputStream target) throws IOException

Transfers the entire contents of this stream to the specified target.

Parameters
target:OutputStream

to write to.

Returns:int

number of bytes written.