Netty:I have Hex values coming from communicating device but when i am sending some hex values to that device it got converted into ASCII values.i think i am stuck between wrong encoder and decoder that i am currently using.
can some one tell me how to send these hexadecimal bytes without getting converted into any other fromat.
and which is the proper way to implement encoder and decoder for the data which is coming in hex values.
the code i am using in netty is-
private class TCPPipelineFactory implements ChannelPipelineFactory {
@SuppressWarnings("deprecation")
@Override
public ChannelPipeline getPipeline() throws Exception {
// Create a default pipeline implementation.
ChannelPipeline pipeline = pipeline();
//pipeline.addLast("readtimeout", new ReadTimeoutHandler(hashedWheelTimer, idleTimeSecsForIncompleteRequests));
// Add the text line codec combination first,
pipeline.addLast("framer", new DelimiterBasedFrameDecoder(8192,
new ChannelBuffer[] {
ChannelBuffers.wrappedBuffer("$<end>".getBytes()) }));
// ChannelBuffers.wrappedBuffer(new byte[] { '#' }) }));
///pipeline.addLast("decoder", new StringDecoder()); to check V123 testing
//pipeline.addLast("encoder", new StringEncoder());
pipeline.addLast("decoder", new ObjectDecoder());
pipeline.addLast("encoder", new ObjectEncoder());
// and then business logic.
pipeline.addLast("handler", new TCPService(TCPFrontChannel.this, commLayerId));
return pipeline;
}
}
}