directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: [MINA] Another useful shortcut
Date Wed, 07 Dec 2005 10:39:33 GMT



From: Trustin Lee [] 
Sent: 07 December 2005 04:33
To: Apache Directory Developers List
Subject: Re: [MINA] Another useful shortcut


Hi Jose,

2005/12/6, Jose Alberto Fernandez <>:

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()


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. 


what we call human nature is actually human habit

View raw message