directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: [MINA] Another useful shortcut
Date Wed, 07 Dec 2005 04:32:49 GMT
Hi Jose,

2005/12/6, Jose Alberto Fernandez <jalberto@cellectivity.com>:
>
>  Hi Trustin,
>
> You are correct. But maybe then, some way to peek at the value (without
> moving the reading position) would do.
>
> Something like:
>
>     int peekInt()
>
>     short peekShort()
>
>     etc.
>
> This will resolve most of the nasty part and allow people to check for
> denials as well.
>

Instead, I added prefixedDataAvailable() to ByteBuffer.  You'll find out
this method is really useful for your use case.  There are two
prefixedDataAvailable(); one with maxDataLength parameter, and the other
without it.  It is up to you which method you're going to use, but I
recommend the former.

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message