public class StringDecoder extends AbstractTransformer<Buffer,java.lang.String>
Buffer to StringAbstractTransformer.LastResultAwareState<K,L>| Modifier and Type | Field and Description |
|---|---|
protected java.nio.charset.Charset |
charset |
protected Attribute<java.lang.Integer> |
lengthAttribute |
protected byte[] |
stringTerminateBytes |
attributeBuilder, stateAttr| Constructor and Description |
|---|
StringDecoder() |
StringDecoder(java.nio.charset.Charset charset) |
StringDecoder(java.nio.charset.Charset charset,
java.lang.String stringTerminator) |
StringDecoder(java.lang.String stringTerminator) |
| Modifier and Type | Method and Description |
|---|---|
java.nio.charset.Charset |
getCharset() |
java.lang.String |
getName()
Get the Transformer name.
|
boolean |
hasInputRemaining(AttributeStorage storage,
Buffer input) |
protected TransformationResult<Buffer,java.lang.String> |
parseWithLengthPrefix(AttributeStorage storage,
Buffer input) |
protected TransformationResult<Buffer,java.lang.String> |
parseWithTerminatingSeq(AttributeStorage storage,
Buffer input) |
void |
release(AttributeStorage storage)
The Transformer has done its work and can release all
associated resource.
|
void |
setCharset(java.nio.charset.Charset charset) |
protected TransformationResult<Buffer,java.lang.String> |
transformImpl(AttributeStorage storage,
Buffer input) |
createStateObject, getLastResult, getMemoryManager, getNamePrefix, getValue, obtainMemoryManager, obtainStateObject, saveLastResult, setMemoryManager, transformprotected java.nio.charset.Charset charset
protected final Attribute<java.lang.Integer> lengthAttribute
protected byte[] stringTerminateBytes
public StringDecoder()
public StringDecoder(java.lang.String stringTerminator)
public StringDecoder(java.nio.charset.Charset charset)
public StringDecoder(java.nio.charset.Charset charset,
java.lang.String stringTerminator)
public java.lang.String getName()
Transformerprotected TransformationResult<Buffer,java.lang.String> transformImpl(AttributeStorage storage, Buffer input) throws TransformationException
transformImpl in class AbstractTransformer<Buffer,java.lang.String>TransformationExceptionprotected TransformationResult<Buffer,java.lang.String> parseWithLengthPrefix(AttributeStorage storage, Buffer input)
protected TransformationResult<Buffer,java.lang.String> parseWithTerminatingSeq(AttributeStorage storage, Buffer input)
public void release(AttributeStorage storage)
Transformerrelease in interface Transformer<Buffer,java.lang.String>release in class AbstractTransformer<Buffer,java.lang.String>storage - the external state storage, where Transformer
could retrieve or store its state.public boolean hasInputRemaining(AttributeStorage storage, Buffer input)
public java.nio.charset.Charset getCharset()
public void setCharset(java.nio.charset.Charset charset)
Copyright © 2018 Oracle Corporation. All Rights Reserved.