public class DataStreams
extends java.lang.Object
inbound(Iterator)
treats multiple ByteString
s as a single input stream and
outbound(OutputChunkConsumer)
treats a single OutputStream
as multiple
ByteString
s.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
ByteString s 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)
ByteString
s 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
.