java.lang.Object
org.sejda.io.BufferedCountingChannelWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
Component providing methods to write to a
CountingWritableByteChannel. This implementation is buffered and bytes are flushed to the CountingWritableByteChannel
only when the buffer is full. The buffer size is configurable using the OUTPUT_BUFFER_SIZE_PROPERTY property.- Author:
- Andrea Vacondio
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()Flush the bufferlongoffset()voidwrite(byte myByte) Writes the single byte to the destinationvoidwrite(byte[] bytes) Writes the given bytes to the destinationvoidwrite(InputStream stream) Writes everything that is read from theInputStreamto the destinationvoidWrites the given string inStandardCharsets.ISO_8859_1voidwriteEOL()
-
Field Details
-
OUTPUT_BUFFER_SIZE_PROPERTY
- See Also:
-
-
Constructor Details
-
BufferedCountingChannelWriter
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
writeEOL
- Throws:
IOException
-
write
Writes the given string inStandardCharsets.ISO_8859_1- Parameters:
value-- Throws:
IOException
-
write
Writes the given bytes to the destination- Parameters:
bytes-- Throws:
IOException
-
write
Writes the single byte to the destination- Parameters:
myByte-- Throws:
IOException
-
write
Writes everything that is read from theInputStreamto the destination- Parameters:
stream-- Throws:
IOException
-
offset
public long offset()- Returns:
- the current offset in the output
-
flush
Flush the buffer- Throws:
IOException
-