79808182838485868788
NtpMessageEncoder encoder = new NtpMessageEncoder(); encoder.encode( replyByteBuffer, message ); print( message ); NtpMessageDecoder decoder = new NtpMessageDecoder(); NtpMessage reply = decoder.decode( replyByteBuffer ); print( reply ); }
646566676869707172
*/ @Test public void testParseClient() throws Exception { ByteBuffer buffer = ByteBuffer.wrap( clientRequest ); NtpMessageDecoder decoder = new NtpMessageDecoder(); NtpMessage request = decoder.decode( buffer ); print( request ); }
798081828384858687
*/ @Test public void testParseServer() throws Exception { ByteBuffer buffer = ByteBuffer.wrap( serverResponse ); NtpMessageDecoder decoder = new NtpMessageDecoder(); NtpMessage request = decoder.decode( buffer ); print( request ); }
3435363738394041
*/ public class NtpDecoder extends ProtocolDecoderAdapter { public void decode( IoSession session, IoBuffer in, ProtocolDecoderOutput out ) { NtpMessageDecoder decoder = new NtpMessageDecoder(); out.write( decoder.decode( in.buf() ) ); }
78798081828384858687
636465666768697071
787980818283848586
3334353637383940