public class ProgressiveCharBufferWriter extends Writer
To be used when your input source is not reactive (uses Writer),
but you have multiple elements to write and thus could take advantage of
reactive output to some extent.
| Constructor and Description |
|---|
ProgressiveCharBufferWriter(Charset charset,
int charBufferSize,
int pageSize) |
| Modifier and Type | Method and Description |
|---|---|
int |
byteBufferContentSize() |
void |
close() |
void |
flush() |
void |
flushToOutput()
Send all buffer pages to the
output,
Even those that are not full yet |
boolean |
isFlowControlPushingBack() |
void |
resumePendingWrites()
Send all full buffer pages to the
output. |
void |
setOutput(org.apache.http.nio.ContentEncoder output)
Set the encoder to write to when buffers are full.
|
void |
write(char[] cbuf,
int off,
int len) |
public ProgressiveCharBufferWriter(Charset charset, int charBufferSize, int pageSize)
public void setOutput(org.apache.http.nio.ContentEncoder output)
public void write(char[] cbuf,
int off,
int len)
throws IOException
write in class WriterIOExceptionpublic void flush()
throws IOException
flush in interface Flushableflush in class WriterIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class WriterIOExceptionpublic void resumePendingWrites()
throws IOException
output.
Flow control may push back, in which case this method or flushToOutput()
should be called again later.
IOException - when ContentEncoder.write(ByteBuffer) fails.public boolean isFlowControlPushingBack()
true if the output pushed
back the last time a write was attempted, false otherwise.public void flushToOutput()
throws IOException
output,
Even those that are not full yet
Flow control may push back, in which case this method should be called again later.
IOException - when ContentEncoder.write(ByteBuffer) fails.Copyright © 2006–2017 Hibernate. All rights reserved.