No i don't flip

This 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.

Cheers,
Brendan


-----Original Message-----
From: Emmanuel Lécharny [mailto:[email protected]] 
Sent: 23 July 2012 17:48
To: [email protected]
Subject: Re: Upgrade considerations between MINA 2.0.0-M3 to 2.0.4

Le 7/23/12 6:14 PM, Brendan Crowley a écrit :
> Just noticed i said org.apache.mina.transport.socket.nio.NioDatagramAcceptor 
> doesn't exist in 2.0.4, i meant to say trunk. can anyone see any issues with 
> the bean declarations ?

org.apache.mina.transport.socket.nio.NioDatagramAcceptor does exist in 
MINA 2.0.4 and in trunk.
>
> My Decoder class extends 
> org.apache.mina.filter.codec.CumulativeProtocolDecoder and by using remote 
> debugger it seems to call 'doDecode' repeatedly in a NioDatagramAcceptor 
> thread after a messageReceived.

Are you sure you flip() the buffer after having decoded it ?



-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com

Reply via email to