Class BoundedByteBuffer.Writer

java.lang.Object
fr.gouv.vitam.common.stream.BoundedByteBuffer.Writer
All Implemented Interfaces:
AutoCloseable
Enclosing class:
BoundedByteBuffer

public class BoundedByteBuffer.Writer extends Object implements AutoCloseable
Writes data to the BoundedByteBuffer At the end of data, should write and End Of File (EOF) using the writeEOF() method Closing the Writer without EOF would throw a IOException (Broken stream) Non thread safe. Writer should be used by a single thread.
  • Method Details

    • write

      public void write(byte[] src, int offset, int length) throws InterruptedException, IOException
      Writes data to buffer. Cannot write more than buffer size
      Throws:
      InterruptedException
      IOException
    • writeEOF

      public void writeEOF()
      Signals that stream ended successfully.
    • close

      public void close()
      Closes the writer & all associated resources. If close() is invoked without writeEOF() the reader side will get an IOException (broken stream).
      Specified by:
      close in interface AutoCloseable