Package io.grpc
Interface Drainable
-
public interface Drainable
Extension to anInputStream
or alike by adding a method that transfers all content to anOutputStream
.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 throughread()
, then writing theOutputStream
, the implementation can write the content directly to theOutputStream
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
drainTo(OutputStream target)
Transfers the entire contents of this stream to the specified target.
-
-
-
Method Detail
-
drainTo
int drainTo(OutputStream target) throws IOException
Transfers the entire contents of this stream to the specified target.- Parameters:
target
- to write to.- Returns:
- number of bytes written.
- Throws:
IOException
-
-