Package fr.gouv.vitam.common.stream
Class BoundedByteBuffer.Writer
- java.lang.Object
-
- fr.gouv.vitam.common.stream.BoundedByteBuffer.Writer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Enclosing class:
- BoundedByteBuffer
public class BoundedByteBuffer.Writer extends java.lang.Object implements java.lang.AutoCloseableWrites data to theBoundedByteBufferAt 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the writer & all associated resources.voidwrite(byte[] src, int offset, int length)Writes data to buffer.voidwriteEOF()Signals that stream ended successfully.
-
-
-
Method Detail
-
write
public void write(byte[] src, int offset, int length) throws java.lang.InterruptedException, java.io.IOExceptionWrites data to buffer. Cannot write more than buffer size- Throws:
java.lang.InterruptedExceptionjava.io.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:
closein interfacejava.lang.AutoCloseable
-
-