public class DataStreams
extends java.lang.Object
inbound(Iterator) treats multiple ByteStrings as a single input stream and
outbound(OutputChunkConsumer) treats a single OutputStream as multiple
ByteStrings.| Modifier and Type | Class and Description |
|---|---|
static class |
DataStreams.BlockingQueueIterator<T>
Allows for one or more writing threads to append values to this iterator while one reading
thread reads values.
|
static class |
DataStreams.DataStreamDecoder<T>
|
static interface |
DataStreams.OutputChunkConsumer<T>
Deprecated.
Used as a temporary placeholder until implementation of
outbound(OutputChunkConsumer). |
| Constructor and Description |
|---|
DataStreams() |
| Modifier and Type | Method and Description |
|---|---|
static java.io.InputStream |
inbound(java.util.Iterator<com.google.protobuf.ByteString> bytes)
Converts multiple
ByteStrings into a single InputStream. |
static java.io.OutputStream |
outbound(DataStreams.OutputChunkConsumer<com.google.protobuf.ByteString> consumer)
Converts a single
OutputStream into multiple ByteStrings. |
public static java.io.InputStream inbound(java.util.Iterator<com.google.protobuf.ByteString> bytes)
ByteStrings into a single InputStream.
The iterator is accessed lazily. The supplied Iterator should block until
either it knows that no more values will be provided or it has the next ByteString.
public static java.io.OutputStream outbound(DataStreams.OutputChunkConsumer<com.google.protobuf.ByteString> consumer)
OutputStream into multiple ByteStrings.