/** * {@inheritDoc} */ public DecodingState decode(IoBuffer in, ProtocolDecoderOutput out) throws Exception { while (in.hasRemaining()) { switch (counter) { case 0: highByte = in.getUnsigned(); break; case 1: counter = 0; return finishDecode((short) ((highByte << 8) | in.getUnsigned()), out); default: throw new InternalError(); } counter ++; } return this; }
/** * {@inheritDoc} */ @Override public DecodingState decode(IoBuffer in, ProtocolDecoderOutput out) throws Exception { int highByte = 0; while (in.hasRemaining()) { switch (counter) { case 0: highByte = in.getUnsigned(); break; case 1: counter = 0; return finishDecode((short) ((highByte << 8) | in.getUnsigned()), out); default: throw new InternalError(); } counter++; } return this; }
/** * {@inheritDoc} */ @Override public DecodingState decode(IoBuffer in, ProtocolDecoderOutput out) throws Exception { int highByte = 0; while (in.hasRemaining()) { switch (counter) { case 0: highByte = in.getUnsigned(); break; case 1: counter = 0; return finishDecode((short) ((highByte << 8) | in.getUnsigned()), out); default: throw new InternalError(); } counter++; } return this; }