Package org.apache.johnzon.core.io
Class BoundedOutputStreamWriter
- java.lang.Object
- 
- java.io.Writer
- 
- org.apache.johnzon.core.io.BoundedOutputStreamWriter
 
 
- 
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
 
 public class BoundedOutputStreamWriter extends Writer OutputStreamWriterdelegating directly to a sun.nio.cs.StreamEncoder with a controlled underlying buffer size. It enables to wrap anOutputStreamas aWriterbut with a faster feedback than a defaultOutputStreamWriterwhich uses a 8k buffer by default (encapsulated).Note: the "flush error" can be of 2 characters (lcb in StreamEncoder) but we can't do much better when encoding. 
- 
- 
Constructor SummaryConstructors Constructor Description BoundedOutputStreamWriter(OutputStream outputStream, Charset charset, int maxSize)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Writerappend(char c)Writerappend(CharSequence csq)Writerappend(CharSequence csq, int start, int end)voidclose()voidflush()voidwrite(char[] cbuf)voidwrite(char[] chars, int off, int len)voidwrite(int c)voidwrite(String str)voidwrite(String str, int off, int len)- 
Methods inherited from class java.io.WriternullWriter
 
- 
 
- 
- 
- 
Field Detail- 
delegateprivate final Writer delegate 
 
- 
 - 
Constructor Detail- 
BoundedOutputStreamWriterpublic BoundedOutputStreamWriter(OutputStream outputStream, Charset charset, int maxSize) 
 
- 
 - 
Method Detail- 
writepublic void write(int c) throws IOException- Overrides:
- writein class- Writer
- Throws:
- IOException
 
 - 
writepublic void write(char[] chars, int off, int len) throws IOException- Specified by:
- writein class- Writer
- Throws:
- IOException
 
 - 
writepublic void write(String str, int off, int len) throws IOException - Overrides:
- writein class- Writer
- Throws:
- IOException
 
 - 
flushpublic void flush() throws IOException- Specified by:
- flushin interface- Flushable
- Specified by:
- flushin class- Writer
- Throws:
- IOException
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein class- Writer
- Throws:
- IOException
 
 - 
writepublic void write(char[] cbuf) throws IOException- Overrides:
- writein class- Writer
- Throws:
- IOException
 
 - 
writepublic void write(String str) throws IOException - Overrides:
- writein class- Writer
- Throws:
- IOException
 
 - 
appendpublic Writer append(CharSequence csq) throws IOException - Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
- Throws:
- IOException
 
 - 
appendpublic Writer append(CharSequence csq, int start, int end) throws IOException - Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
- Throws:
- IOException
 
 - 
appendpublic Writer append(char c) throws IOException - Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
- Throws:
- IOException
 
 
- 
 
-