public class StringLineDecoder implements Decoder {
private static final byte LINE_LIMITOR = '\n';
@Override
public void decode(ByteBuffer buffer, Session session) throws Throwable {
SessionAttachment sessionInfo = (SessionAttachment)session.getAttachment();
ByteBuffer now = buffer;
ByteBuffer prev = sessionInfo.byteBuffer;
if (prev != null) {
sessionInfo.byteBuffer = null;