mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hieu Phan Thanh" <hie...@Cybersoft-VN.com>
Subject RE: [MINA] ByteBuffer - how to ignore the remained data in ByteBuffer?
Date Fri, 27 Oct 2006 08:39:09 GMT
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:hieupt@Cybersoft-VN.com]
> 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.
> 
> 



Mime
View raw message