public class BufferedCountingChannelWriter extends Object implements Closeable
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.| Modifier and Type | Field and Description |
|---|---|
static String |
OUTPUT_BUFFER_SIZE_PROPERTY |
| Constructor and Description |
|---|
BufferedCountingChannelWriter(CountingWritableByteChannel channel) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
flush()
Flush the buffer
|
long |
offset() |
void |
write(byte myByte)
Writes the single byte to the destination
|
void |
write(byte[] bytes)
Writes the given bytes to the destination
|
void |
write(InputStream stream)
Writes everything that is read from the
InputStream to the destination |
void |
write(String value)
Writes the given string in
Charsets.ISO_8859_1 |
void |
writeEOL() |
public static final String OUTPUT_BUFFER_SIZE_PROPERTY
public BufferedCountingChannelWriter(CountingWritableByteChannel channel)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic void writeEOL()
throws IOException
IOExceptionpublic void write(String value) throws IOException
Charsets.ISO_8859_1value - IOExceptionpublic void write(byte[] bytes)
throws IOException
bytes - IOExceptionpublic void write(byte myByte)
throws IOException
myByte - IOExceptionpublic void write(InputStream stream) throws IOException
InputStream to the destinationstream - IOExceptionpublic long offset()
public void flush()
throws IOException
IOExceptionCopyright © 2018 sejda. All rights reserved.