Now I could do what I want:
----------------------------------
while (in.hasRemaining()) {
        in.get();
}
----------------------------------

I wonder if there is any other way to do it? Please advice to update.

Thanks & best regards,
Hieu Phan.


> -----Original Message-----
> From: Hieu Phan Thanh [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 27, 2006 1:11 PM
> To: mina-dev@directory.apache.org
> Subject: [MINA] ByteBuffer - how to ignore the remained data in
> ByteBuffer?
> 
> Hi,
> 
> How could I ignore the remained data in the ByteBuffer after finishing
> decoding the message?
> 
> I tried to do the thing below:
> - Before decoding the ByteBuffer:
>       bufferSize = in.remaining();
> - Then read and decode the ByteBuffer to high-level object:
>       doDecode();
> - Set positon for ByteBuffer:
>       in.position(bufferSize);
> But it did not work correctly.
> Please advice me.
> 
> Thanks & best regards,
> Hieu Phan.
> 
> 


Reply via email to