You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Andreas Menke <as...@snafu.de> on 2012/02/11 18:01:22 UTC

[codec]Bug or Feature

Hi,

from BaseNCodec.java:

how does resizeBuffer() know how big 'int size' is? Bug or Feature?

     /**
      * Ensure that the buffer has room for <code>size</code> bytes
      *
      * @param size minimum spare space required
      */
     protected void ensureBufferSize(int size){
         if ((buffer == null) || (buffer.length < pos + size)){
             resizeBuffer();
         }
     }

Regards

Andreas

-- 


Andreas Menke

Diplom-Informatiker Univ.
Software-Entwicklung

Fon  0151 5081 1173
Mail asmenke@snafu.de


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [codec]Bug or Feature

Posted by Dave Brosius <db...@apache.org>.
looks wrong to me as well.



On 02/11/2012 12:01 PM, Andreas Menke wrote:
> Hi,
>
> from BaseNCodec.java:
>
> how does resizeBuffer() know how big 'int size' is? Bug or Feature?
>
>     /**
>      * Ensure that the buffer has room for <code>size</code> bytes
>      *
>      * @param size minimum spare space required
>      */
>     protected void ensureBufferSize(int size){
>         if ((buffer == null) || (buffer.length < pos + size)){
>             resizeBuffer();
>         }
>     }
>
> Regards
>
> Andreas
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [codec]Bug or Feature

Posted by Gary Gregory <ga...@gmail.com>.
Hi Andreas,

Feel free to provide a test and a patch ;)

Gary

On Feb 11, 2012, at 13:39, Andreas Menke <as...@snafu.de> wrote:

> Hi,
>
> from BaseNCodec.java:
>
> how does resizeBuffer() know how big 'int size' is? Bug or Feature?
>
>    /**
>     * Ensure that the buffer has room for <code>size</code> bytes
>     *
>     * @param size minimum spare space required
>     */
>    protected void ensureBufferSize(int size){
>        if ((buffer == null) || (buffer.length < pos + size)){
>            resizeBuffer();
>        }
>    }
>
> Regards
>
> Andreas
>
> --
>
>
> Andreas Menke
>
> Diplom-Informatiker Univ.
> Software-Entwicklung
>
> Fon  0151 5081 1173
> Mail asmenke@snafu.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org