dev@grizzly.java.net

Re: About BuffersBuffer#mark() and reset()

From: Bongjae Chang <bongjae.chang_at_gmail.com>
Date: Fri, 06 Jan 2012 11:41:35 +0900

Hi Alexey,

I committed the changes. It is issue #1169.

HeapBuffer.java was also changed a little bit. ex) HeapBuffer#reset() will
throw InvalidMarkException according to javadoc. I think the change doesn't
have side-effect because I could find the usage case of Buffer#reset().

Thanks.

Regards,
Bongjae Chang

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Reply-To: <dev_at_grizzly.java.net>
Date: Thu, 05 Jan 2012 15:10:57 +0100
To: <dev_at_grizzly.java.net>
Subject: Re: About BuffersBuffer#mark() and reset()

    
 On 01/05/2012 03:00 PM, Bongjae Chang wrote:
>
> Hi,
>
>
>
>
> BuffersBuffer#mark() and BuffersBuffer#reset() throw currently
> UnsupportedOperationException.
>
>
>
>
> Could I know why they are not supported?
>
>
>
>
> When I parsed packets, sometimes the input buffer of my filter could become to
> be BuffersBuffer type if there was the remainder.
>
>
>
>
> At that time, I got the exception if I used mark() and reset() methods.
>
>
>
>
> So I stored the position of BuffersBuffer when I needed mark() and changed
> current position into the stored position when I needed reset() temporarily(It
> is the similar behavior to the HeapBuffer#mark() and reset()).
>
>
>
>
> If there were any issues about BuffersBuffer#mark() and reset(), I think that
> I should also consider them again when I parses packets of BuffersBuffer type.
>
>
>
>
> So I would like to know the reason.
>
 AFAIR there was no specific reason.
 You can implement it similar way it's implemented in HeapBuffer and commit
the change.
 
 Thanks.
 
 WBR,
 Alexey.
 
 
>
>
>
>
> Thanks.
>
>
>
>
> Regards,
>
> Bongjae Chang
>
>
>
>
>
>
>