@Override public ProtocolDecoder getDecoder(IoSession is) throws Exception { return new CumulativeProtocolDecoder() { protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception { if (in.remaining() > 0) { byte[] buf = new byte[in.remaining()]; in.get(buf); out.write(new String(buf, "US-ASCII")); return true; } else { return false; } } }; }
public ProtocolDecoder getDecoder() throws Exception { return new CumulativeProtocolDecoder() { protected boolean doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception { if (in.remaining() > 0) { byte[] buf = new byte[in.remaining()]; in.get(buf); out.write(new String(buf, "US-ASCII")); return true; } else { return false; } } }; }
@Override public ProtocolDecoder getDecoder(IoSession ioSession) throws Exception { if(mDecoder == null) { mDecoder = new UltravoxDecoder(); } return mDecoder; }
@Override public ProtocolDecoder getDecoder(IoSession session) throws Exception { MinaDecoder minaDecoder = null; Object value = session.getAttribute(DECODER_ATTRIBUTE); if (value != null && value instanceof MinaDecoder) minaDecoder = (MinaDecoder) value; if (minaDecoder == null) { minaDecoder = new MinaDecoder(codecFactory.getDecoder()); session.setAttribute(DECODER_ATTRIBUTE, minaDecoder); } return minaDecoder; }
@Override public ProtocolDecoder getDecoder(IoSession arg0) throws Exception { return decoder; }
@Override public ProtocolDecoder getDecoder(IoSession session) throws Exception { return msgDecoder; }
public ProtocolDecoder getDecoder() { return decoder; }
public ProtocolDecoder getDecoder(IoSession session) { return decoder; }
/** * {@inheritDoc} */ public ProtocolDecoder getDecoder(IoSession session) throws Exception { return decoder; }
public ProtocolDecoder getDecoder(IoSession session) throws Exception { return decoder; }
public ProtocolDecoder getDecoder() throws Exception { return decoder; }
@Override public ProtocolDecoder getDecoder(IoSession session) throws Exception { return decoder; }
@Override public ProtocolDecoder getDecoder() throws Exception { return decoder; }
/** * 返回一个新的(或可重复使用的)ProtocolDecoder实例 */ public ProtocolDecoder getDecoder(IoSession session) throws Exception { return decoder; }
public ProtocolDecoder getDecoder(IoSession session) throws Exception { return new HL7MLLPDecoder(config); }