Package org.apache.juneau.internal
Class StringBuilderWriter
java.lang.Object
java.io.Writer
org.apache.juneau.internal.StringBuilderWriter
- All Implemented Interfaces:
- Closeable,- Flushable,- Appendable,- AutoCloseable
Similar to 
StringWriter, but uses a StringBuilder instead to avoid synchronization overhead.
 Notes:
- This class is not thread safe.
See Also:
- 
Field Summary
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new string writer using the default initial string-builder size.StringBuilderWriter(int initialSize) Create a new string writer using the specified initial string-builder size.Create a new string writer around an existing string builder.
- 
Method SummaryModifier and TypeMethodDescriptionappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) voidclose()voidflush()toString()voidwrite(char[] cbuf, int start, int length) voidwrite(int c) voidvoidMethods inherited from class java.io.WriternullWriter, write
- 
Constructor Details- 
StringBuilderWriterpublic StringBuilderWriter()Create a new string writer using the default initial string-builder size.
- 
StringBuilderWriterCreate a new string writer around an existing string builder.- Parameters:
- sb- The string builder being wrapped.
 
- 
StringBuilderWriterCreate a new string writer using the specified initial string-builder size.- Parameters:
- initialSize- The number of char values that will fit into this buffer before it is automatically expanded.
- Throws:
- IllegalArgumentException- If initialSize is negative.
 
 
- 
- 
Method Details- 
write
- 
write
- 
write
- 
write
- 
append- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
 
- 
append- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
 
- 
append- Specified by:
- appendin interface- Appendable
- Overrides:
- appendin class- Writer
 
- 
toString
- 
flush
- 
close- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Specified by:
- closein class- Writer
- Throws:
- IOException
 
 
-