com.sun.grizzly.utils
Class StringDecoder
java.lang.Object
com.sun.grizzly.AbstractTransformer<Buffer,String>
com.sun.grizzly.utils.StringDecoder
- All Implemented Interfaces:
- Transformer<Buffer,String>
- Direct Known Subclasses:
- SmartStringDecoder
public class StringDecoder
- extends AbstractTransformer<Buffer,String>
String decoder, which decodes Buffer to String
- Author:
- Alexey Stashok
| Methods inherited from class com.sun.grizzly.AbstractTransformer |
getInput, getLastResult, getMemoryManager, getOutput, getProperties, getValue, hibernate, obtainMemoryManager, setInput, setMemoryManager, setOutput, transform |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
charset
protected Charset charset
stateAttribute
protected Attribute<Integer> stateAttribute
stringTerminateBytes
protected byte[] stringTerminateBytes
StringDecoder
public StringDecoder()
StringDecoder
public StringDecoder(String stringTerminator)
StringDecoder
public StringDecoder(Charset charset)
StringDecoder
public StringDecoder(Charset charset,
String stringTerminator)
transform
public TransformationResult<String> transform(AttributeStorage storage,
Buffer input,
String output)
throws TransformationException
- Description copied from interface:
Transformer
- Transforms an input data to some custom representation.
- Parameters:
storage - the external state storage, where Transformer
could retrieve or store its state.
- Returns:
- the result
TransformationResult
- Throws:
TransformationException
parseWithLengthPrefix
protected TransformationResult<String> parseWithLengthPrefix(AttributeStorage storage,
Buffer input)
parseWithTerminatingSeq
protected TransformationResult<String> parseWithTerminatingSeq(AttributeStorage storage,
Buffer input)
release
public void release(AttributeStorage storage)
- Description copied from interface:
Transformer
- The Transformer has done its work and can release all
associated resource.
- Specified by:
release in interface Transformer<Buffer,String>- Overrides:
release in class AbstractTransformer<Buffer,String>
- Parameters:
storage - the external state storage, where Transformer
could retrieve or store its state.
getCharset
public Charset getCharset()
setCharset
public void setCharset(Charset charset)
saveState
protected void saveState(AttributeStorage storage,
TransformationResult<String> result,
Integer state)
Copyright © 2009 SUN Microsystems. All Rights Reserved.