Package com.fizzed.rocker.runtime
Class StringBuilderOutput
java.lang.Object
com.fizzed.rocker.runtime.AbstractRockerOutput<StringBuilderOutput>
com.fizzed.rocker.runtime.StringBuilderOutput
- All Implemented Interfaces:
RockerOutput<AbstractRockerOutput>
Output that wraps an
StringBuilder. Optimized for writing
Strings vs. Bytes. Bytes are converted to Strings using the specified charset
on each write.-
Field Summary
FieldsFields inherited from class com.fizzed.rocker.runtime.AbstractRockerOutput
byteLength, charset, contentType -
Constructor Summary
ConstructorsConstructorDescriptionStringBuilderOutput(ContentType contentType, String charsetName) StringBuilderOutput(ContentType contentType, String charsetName, int intialSize) StringBuilderOutput(ContentType contentType, Charset charset) StringBuilderOutput(ContentType contentType, Charset charset, int intialSize) -
Method Summary
Methods inherited from class com.fizzed.rocker.runtime.AbstractRockerOutput
getByteLength, getCharset, getContentType
-
Field Details
-
FACTORY
-
buffer
-
-
Constructor Details
-
StringBuilderOutput
-
StringBuilderOutput
-
StringBuilderOutput
-
StringBuilderOutput
-
-
Method Details
-
getBuffer
-
w
Description copied from interface:RockerOutputWrites a String to the output. Implementations are responsible for handling the conversion to the correct charset. Note that underlying implementations may be optimized to handle Strings vs. Bytes.- Parameters:
string- The string to write- Returns:
- This output (so builder pattern can be used)
- Throws:
IOException- Thrown on exception.
-
w
- Throws:
IOException
-
toString
- Specified by:
toStringin interfaceRockerOutput<AbstractRockerOutput>- Overrides:
toStringin classObject
-