Package com.fizzed.rocker.runtime
Class AbstractRockerOutput<T extends AbstractRockerOutput>
- java.lang.Object
-
- com.fizzed.rocker.runtime.AbstractRockerOutput<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
RockerOutput<AbstractRockerOutput>
- Direct Known Subclasses:
ArrayOfByteArraysOutput,OutputStreamOutput,StringBuilderOutput
public abstract class AbstractRockerOutput<T extends AbstractRockerOutput> extends java.lang.Object implements RockerOutput<AbstractRockerOutput>
Output that wraps anOutputStream. Optimized for writing bytes vs. Strings. Strings are converted to bytes using the specified charset on each write.
-
-
Field Summary
Fields Modifier and Type Field Description protected intbyteLengthprotected java.nio.charset.Charsetcharsetprotected ContentTypecontentType
-
Constructor Summary
Constructors Constructor Description AbstractRockerOutput(ContentType contentType, java.lang.String charsetName, int byteLength)AbstractRockerOutput(ContentType contentType, java.nio.charset.Charset charset, int byteLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetByteLength()java.nio.charset.CharsetgetCharset()ContentTypegetContentType()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.fizzed.rocker.RockerOutput
toString, w, w
-
-
-
-
Field Detail
-
contentType
protected final ContentType contentType
-
charset
protected final java.nio.charset.Charset charset
-
byteLength
protected int byteLength
-
-
Constructor Detail
-
AbstractRockerOutput
public AbstractRockerOutput(ContentType contentType, java.lang.String charsetName, int byteLength)
-
AbstractRockerOutput
public AbstractRockerOutput(ContentType contentType, java.nio.charset.Charset charset, int byteLength)
-
-
Method Detail
-
getContentType
public ContentType getContentType()
- Specified by:
getContentTypein interfaceRockerOutput<T extends AbstractRockerOutput>
-
getCharset
public java.nio.charset.Charset getCharset()
- Specified by:
getCharsetin interfaceRockerOutput<T extends AbstractRockerOutput>
-
getByteLength
public int getByteLength()
- Specified by:
getByteLengthin interfaceRockerOutput<T extends AbstractRockerOutput>
-
-