org.craft.atom.protocol.textline
Class TextLineDecoder

java.lang.Object
  extended by org.craft.atom.protocol.AbstractProtocolCodec
      extended by org.craft.atom.protocol.AbstractProtocolDecoder
          extended by org.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

Field Summary
 
Fields inherited from class org.craft.atom.protocol.AbstractProtocolDecoder
buf, defaultBufferSize, maxSize, searchIndex, splitIndex, stateIndex
 
Fields inherited from class org.craft.atom.protocol.AbstractProtocolCodec
charset
 
Constructor Summary
TextLineDecoder()
           
TextLineDecoder(Charset charset)
           
TextLineDecoder(Charset charset, String delimiter)
           
TextLineDecoder(Charset charset, String delimiter, int defaultBufferSize)
           
TextLineDecoder(Charset charset, String delimiter, int defaultBufferSize, int maxLineLength)
           
 
Method Summary
 List<String> decode(byte[] bytes)
           
 
Methods inherited from class org.craft.atom.protocol.AbstractProtocolDecoder
getBuf, getDefaultBufferSize, getMaxSize, getSearchIndex, getSplitIndex, getStateIndex, reset, setBuf, setDefaultBufferSize, setMaxSize, setSearchIndex, setSplitIndex, setStateIndex, toString
 
Methods inherited from class org.craft.atom.protocol.AbstractProtocolCodec
getCharset, setCharset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 maxLineLength)
Method Detail

decode

public List<String> decode(byte[] bytes)
                    throws ProtocolException
Specified by:
decode in interface ProtocolDecoder<String>
Throws:
ProtocolException


Copyright © 2013. All Rights Reserved.