Package org.apache.beam.sdk.io
Class TFRecordIO.Sink
- java.lang.Object
-
- org.apache.beam.sdk.io.TFRecordIO.Sink
-
- All Implemented Interfaces:
java.io.Serializable
,FileIO.Sink<byte[]>
- Enclosing class:
- TFRecordIO
public static class TFRecordIO.Sink extends java.lang.Object implements FileIO.Sink<byte[]>
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Sink()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
Flushes the buffered state (if any) before the channel is closed.void
open(java.nio.channels.WritableByteChannel channel)
Initializes writing to the given channel.void
write(byte[] element)
Appends a single element to the file.
-
-
-
Method Detail
-
open
public void open(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
Description copied from interface:FileIO.Sink
Initializes writing to the given channel. Will be invoked once on a givenFileIO.Sink
instance.- Specified by:
open
in interfaceFileIO.Sink<byte[]>
- Throws:
java.io.IOException
-
write
public void write(byte[] element) throws java.io.IOException
Description copied from interface:FileIO.Sink
Appends a single element to the file. May be invoked zero or more times.- Specified by:
write
in interfaceFileIO.Sink<byte[]>
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
Description copied from interface:FileIO.Sink
Flushes the buffered state (if any) before the channel is closed. Does not need to close the channel. Will be invoked once.- Specified by:
flush
in interfaceFileIO.Sink<byte[]>
- Throws:
java.io.IOException
-
-