Package org.apache.beam.sdk.fn.stream
Class DataStreams.ElementDelimitedOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.beam.sdk.fn.stream.DataStreams.ElementDelimitedOutputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
- Enclosing class:
- DataStreams
public static final class DataStreams.ElementDelimitedOutputStream extends java.io.OutputStreamAn adapter which wraps anDataStreams.OutputChunkConsumeras anOutputStream.Note that this adapter follows the Beam Fn API specification for forcing values that encode producing zero bytes to produce exactly one byte.
Note that users must invoke
delimitElement()at each element boundary.
-
-
Constructor Summary
Constructors Constructor Description ElementDelimitedOutputStream(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p48p1.com.google.protobuf.ByteString> consumer, int maximumChunkSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voiddelimitElement()voidwrite(byte[] b, int offset, int length)voidwrite(int i)
-
-
-
Constructor Detail
-
ElementDelimitedOutputStream
public ElementDelimitedOutputStream(DataStreams.OutputChunkConsumer<org.apache.beam.vendor.grpc.v1p48p1.com.google.protobuf.ByteString> consumer, int maximumChunkSize)
-
-
Method Detail
-
delimitElement
public void delimitElement() throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(int i) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int offset, int length) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
-