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 class  | DataStreams.ElementDelimitedOutputStreamAn adapter which wraps an  DataStreams.OutputChunkConsumeras anOutputStream. | 
| static interface  | DataStreams.OutputChunkConsumer<T>A callback which is invoked whenever the  outbound(org.apache.beam.sdk.fn.stream.DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString>)OutputStreambecomes full. | 
| Modifier and Type | Field and Description | 
|---|---|
| static int | DEFAULT_OUTBOUND_BUFFER_LIMIT_BYTES | 
| Constructor and Description | 
|---|
| DataStreams() | 
| Modifier and Type | Method and Description | 
|---|---|
| static java.io.InputStream | inbound(java.util.Iterator<org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString> bytes)Converts multiple  ByteStrings into a singleInputStream. | 
| static DataStreams.ElementDelimitedOutputStream | outbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString> consumer)Converts a single element delimited  OutputStreaminto multipleByteStrings. | 
| static DataStreams.ElementDelimitedOutputStream | outbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString> consumer,
        int maximumChunkSize)Converts a single element delimited  OutputStreaminto multipleByteStringsusing the specified maximum chunk size. | 
public static final int DEFAULT_OUTBOUND_BUFFER_LIMIT_BYTES
public static java.io.InputStream inbound(java.util.Iterator<org.apache.beam.vendor.grpc.v1p21p0.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.
 
Note that this InputStream follows the Beam Fn API specification for forcing values
 that decode consuming zero bytes to consuming exactly one byte.
public static DataStreams.ElementDelimitedOutputStream outbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString> consumer)
OutputStream into multiple ByteStrings.
 Note that users must call DataStreams.ElementDelimitedOutputStream.delimitElement() after each
 element.
 
Note that this OutputStream follows the Beam Fn API specification for forcing values
 that encode producing zero bytes to produce exactly one byte.
public static DataStreams.ElementDelimitedOutputStream outbound(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p21p0.com.google.protobuf.ByteString> consumer, int maximumChunkSize)
OutputStream into multiple ByteStrings using the specified maximum chunk size.
 Note that users must call DataStreams.ElementDelimitedOutputStream.delimitElement() after each
 element.
 
Note that this OutputStream follows the Beam Fn API specification for forcing values
 that encode producing zero bytes to produce exactly one byte.