//
// 1. Convert message to a stream that can be decoded.
ChannelBuffer buffer = (ChannelBuffer) msg;
ChannelBufferInputStream inputStream = new ChannelBufferInputStream(buffer);
// 2. Get first byte: message type:
int enumValue = inputStream.readByte();
RequestType type = RequestType.values()[enumValue];
if (LOG.isDebugEnabled()) {
LOG.debug("decode: Got a response of type " + type + " from server:" +
channel.getRemoteAddress());
}