On Fri, Jun 26, 2009 at 10:51 AM, Anand Bora<[email protected]> wrote: > Hi all, > > I'm facing a weird issue. I'm trying to find out the current length of the > ByteBuffer which is filled with data. > I tried to use the position() function but the problem is it increments the > position also. > What is the exact function which can give me the filled up length, if any?
1) I guess that you submitted this message 3 times by mistake... Thanks to be careful : it's not because it does not appears in the list that it has not been received. You probably use a mail system which adds a stupid DISCLAIMER which requires us to moderate it by hand, otherwise the mail might be considered as Spam. 2) *always* mention the software version you are using. ByteBuffer can be either the java ByteBuffer or the MINA 1.1.x ByteBuffer. Here, I assume you are using MINA 1.1.x. 3) When you write "...the problem is it increments the position also" what *exactly* do you mean ? ByteBuffer.position() gives you the *current* position on the buffer. It does not gives you the number of elements present on the buffer. It's all explained in the Javadoc, btw, so a bit of reading could help at this point... -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
