Package com.fizzed.rocker.runtime
Class OutputStreamOutput
java.lang.Object
com.fizzed.rocker.runtime.AbstractRockerOutput<OutputStreamOutput>
com.fizzed.rocker.runtime.OutputStreamOutput
- All Implemented Interfaces:
RockerOutput<AbstractRockerOutput>
Output that wraps an
OutputStream. Optimized for writing bytes
vs. Strings. Strings are converted to bytes using the specified charset on
each write.-
Field Summary
FieldsFields inherited from class com.fizzed.rocker.runtime.AbstractRockerOutput
byteLength, charset, contentType -
Constructor Summary
ConstructorsConstructorDescriptionOutputStreamOutput(ContentType contentType, OutputStream stream, String charsetName) OutputStreamOutput(ContentType contentType, OutputStream stream, Charset charset) -
Method Summary
Methods inherited from class com.fizzed.rocker.runtime.AbstractRockerOutput
getByteLength, getCharset, getContentTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.fizzed.rocker.RockerOutput
toString
-
Field Details
-
stream
-
-
Constructor Details
-
OutputStreamOutput
-
OutputStreamOutput
-
-
Method Details
-
getStream
-
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
-