Package fr.gouv.vitam.common.stream
Class BoundedByteBuffer.Writer
java.lang.Object
fr.gouv.vitam.common.stream.BoundedByteBuffer.Writer
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- BoundedByteBuffer
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 Summary
-
Method Details
-
write
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 interfaceAutoCloseable
-