Class ByteOutputContext.ByteOutputStream

  • All Implemented Interfaces:
    java.lang.AutoCloseable, TransferOutputStream
    Enclosing class:
    ByteOutputContext

    public final class ByteOutputContext.ByteOutputStream
    extends java.lang.Object
    implements TransferOutputStream
    An OutputStream implementation which buffers data to ByteBufs.

    Public methods are thread safe, although the execution order may not be linearized if they were called from different threads.

    • Constructor Detail

      • ByteOutputStream

        public ByteOutputStream()
    • Method Detail

      • writeSerializedPartitionBuffer

        public ByteOutputContext.ByteOutputStream writeSerializedPartitionBuffer​(SerializedPartition serializedPartition,
                                                                                 boolean releaseOnComplete)
                                                                          throws java.io.IOException
        Parameters:
        serializedPartition - SerializedPartition to write.
        releaseOnComplete - wheter to release the partition upon completion.
        Returns:
        this
        Throws:
        java.io.IOException - when an exception has been set or this stream was closed
      • writeFileArea

        public ByteOutputContext.ByteOutputStream writeFileArea​(FileArea fileArea)
                                                         throws java.io.IOException
        Writes a data frame from FileArea.
        Parameters:
        fileArea - the FileArea to transfer
        Returns:
        this
        Throws:
        java.io.IOException - when failed to open the file, an exception has been set, or this stream was closed
      • close

        public void close()
                   throws java.io.IOException
        Description copied from interface: TransferOutputStream
        Closes this output stream.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface TransferOutputStream
        Throws:
        java.io.IOException - if any exception has occurred. For more information, see ByteOutputContext.close().
      • writeElement

        public void writeElement​(java.lang.Object element,
                                 Serializer serializer)
        Write an element to the channel.
        Specified by:
        writeElement in interface TransferOutputStream
        Parameters:
        element - element
        serializer - serializer