You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2014/11/10 14:16:45 UTC

[codec] org.apache.commons.codec.BinaryEncoder for ByteBuffer

If we updated:

public interface BinaryEncoder extends Encoder {

    /**
     * Encodes a byte array and return the encoded data as a byte array.
     *
     * @param source
     *            Data to be encoded
     * @return A byte array containing the encoded data
     * @throws EncoderException
     *             thrown if the Encoder encounters a failure condition
during the encoding process.
     */
    byte[] encode(byte[] source) throws EncoderException;
}

to:

public interface BinaryEncoder extends Encoder {

    /**
     * Encodes a byte array and return the encoded data as a byte array.
     *
     * @param source
     *            Data to be encoded
     * @return A byte array containing the encoded data
     * @throws EncoderException
     *             thrown if the Encoder encounters a failure condition
during the encoding process.
     */
    byte[] encode(byte[] source) throws EncoderException;

    byte[] encode(ByteBuffer source) throws EncoderException;

}

(and the same for BinaryDecoder)

cause [codec] to jump to 2.0 (and all that it entails) instead of 1.11?

Gary



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [codec] org.apache.commons.codec.BinaryEncoder for ByteBuffer

Posted by Gary Gregory <ga...@gmail.com>.
That's a clever idea! Thank you Thomas. For now, I'll leave out any
interface fiddling as it is not essential ATM.

Gary

On Mon, Nov 10, 2014 at 9:05 AM, Thomas Neidhart <th...@gmail.com>
wrote:

> On 11/10/2014 02:16 PM, Gary Gregory wrote:
> > If we updated:
> >
> > public interface BinaryEncoder extends Encoder {
> >
> >     /**
> >      * Encodes a byte array and return the encoded data as a byte array.
> >      *
> >      * @param source
> >      *            Data to be encoded
> >      * @return A byte array containing the encoded data
> >      * @throws EncoderException
> >      *             thrown if the Encoder encounters a failure condition
> > during the encoding process.
> >      */
> >     byte[] encode(byte[] source) throws EncoderException;
> > }
> >
> > to:
> >
> > public interface BinaryEncoder extends Encoder {
> >
> >     /**
> >      * Encodes a byte array and return the encoded data as a byte array.
> >      *
> >      * @param source
> >      *            Data to be encoded
> >      * @return A byte array containing the encoded data
> >      * @throws EncoderException
> >      *             thrown if the Encoder encounters a failure condition
> > during the encoding process.
> >      */
> >     byte[] encode(byte[] source) throws EncoderException;
> >
> >     byte[] encode(ByteBuffer source) throws EncoderException;
> >
> > }
> >
> > (and the same for BinaryDecoder)
>
> why not make a NIOBinaryEncoder interface that extends BinaryEncoder and
> adds the new method?
>
> This would allow us to stay on the 1.x branch.
>
> Thomas
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: [codec] org.apache.commons.codec.BinaryEncoder for ByteBuffer

Posted by Thomas Neidhart <th...@gmail.com>.
On 11/10/2014 02:16 PM, Gary Gregory wrote:
> If we updated:
> 
> public interface BinaryEncoder extends Encoder {
> 
>     /**
>      * Encodes a byte array and return the encoded data as a byte array.
>      *
>      * @param source
>      *            Data to be encoded
>      * @return A byte array containing the encoded data
>      * @throws EncoderException
>      *             thrown if the Encoder encounters a failure condition
> during the encoding process.
>      */
>     byte[] encode(byte[] source) throws EncoderException;
> }
> 
> to:
> 
> public interface BinaryEncoder extends Encoder {
> 
>     /**
>      * Encodes a byte array and return the encoded data as a byte array.
>      *
>      * @param source
>      *            Data to be encoded
>      * @return A byte array containing the encoded data
>      * @throws EncoderException
>      *             thrown if the Encoder encounters a failure condition
> during the encoding process.
>      */
>     byte[] encode(byte[] source) throws EncoderException;
> 
>     byte[] encode(ByteBuffer source) throws EncoderException;
> 
> }
> 
> (and the same for BinaryDecoder)

why not make a NIOBinaryEncoder interface that extends BinaryEncoder and
adds the new method?

This would allow us to stay on the 1.x branch.

Thomas

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