Le 7/23/12 7:13 PM, Brendan Crowley a écrit :
No i don't flipThis is the decode method: private ServiceEnvironmentMessage decode(byte[] stream) throws DecoderException { ByteBuffer bb = ByteBuffer.wrap(stream); ServiceEnvironmentMessageContainer container = new ServiceEnvironmentMessageContainer(ServiceEnvironmentMessageGrammar.getInstance()); decoder.decode(bb, container); ServiceEnvironmentMessage message = container.getServiceEnvironmentMessage(); // Clean the container for the next decoding container.clean(); return message; } I don't understand how to flip the buffer after decoding? I could invoke bb.flip(); but this would have no effect.
This is not here that th ebuffer should be flipped. You already have extracted the byte[] out of the IoBuffer.
I need to see the whole code in order to provide some help (at least, the way you implementd the decoder)
-- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
