public static final class DataStreams.ElementDelimitedOutputStream
extends java.io.OutputStream
DataStreams.OutputChunkConsumer
as an OutputStream
.
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 and Description |
---|
ElementDelimitedOutputStream(DataStreams.OutputChunkConsumer<com.google.protobuf.ByteString> consumer,
int maximumChunkSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
delimitElement() |
void |
write(byte[] b,
int offset,
int length) |
void |
write(int i) |
public ElementDelimitedOutputStream(DataStreams.OutputChunkConsumer<com.google.protobuf.ByteString> consumer, int maximumChunkSize)
public void delimitElement() throws java.io.IOException
java.io.IOException
public void write(int i) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int offset, int length) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException