This is the mail archive of the
mailing list for the Java project.
Re: [PATCH]: DatagramChannel + Misc. Channel Fixes
On Tue, Feb 03, 2004 at 09:37:13AM -0600, Mohan Embar wrote:
> Hi Michael,
> >> Here you go....
> >Now I go ...
> >> - int len = dst.remaining();
> >> + int len = dst.capacity() - dst.position();
> >Why is this needed ? This means that we write probably more data into
> >the buffer then is suitable. I think we have to honor limit(). This is
> >automatically done by using remaining().
> >Can you write a little example proving I'm wrong ? (not that big NetTest
> dst.remaining() means that there are dst.remaining() bytes in the buffer
> and we want to do something with them. That isn't the case here. Here,
> we want to put data into the buffer and dst.capacity() - dst.position() is
> the number of bytes we're allowed to store into the buffer.
Oh yeah, sorry. I totally lost the point. Please go ahead and commit to
trunk. I can then commit this to 3.4 too.