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