io.craft.atom.protocol.textline
Class TextLineDecoder
java.lang.Object
io.craft.atom.protocol.AbstractProtocolCodec
io.craft.atom.protocol.AbstractProtocolDecoder
io.craft.atom.protocol.textline.TextLineDecoder
- All Implemented Interfaces:
- ProtocolDecoder<String>
public class TextLineDecoder
- extends AbstractProtocolDecoder
- implements ProtocolDecoder<String>
A ProtocolDecoder which decodes bytes into text line string, default charset is utf-8
Not thread safe
- Version:
- 1.0, Oct 16, 2012
- Author:
- Hu Feng
| Methods inherited from class io.craft.atom.protocol.AbstractProtocolDecoder |
adapt, getBuf, getDefaultBufferSize, getMaxSize, getSearchIndex, getSplitIndex, getState, getStateIndex, reset, setBuf, setDefaultBufferSize, setMaxSize, setSearchIndex, setSplitIndex, setStateIndex, toString |
TextLineDecoder
public TextLineDecoder()
TextLineDecoder
public TextLineDecoder(Charset charset)
TextLineDecoder
public TextLineDecoder(Charset charset,
String delimiter)
TextLineDecoder
public TextLineDecoder(Charset charset,
String delimiter,
int defaultBufferSize)
TextLineDecoder
public TextLineDecoder(Charset charset,
String delimiter,
int defaultBufferSize,
int maxSize)
decode
public List<String> decode(byte[] bytes)
throws ProtocolException
- Specified by:
decode in interface ProtocolDecoder<String>
- Throws:
ProtocolException
setDelimiter
public void setDelimiter(String delimiter)
Copyright © 2014. All Rights Reserved.