Yeah, I wasn't sure either so I went with safe. I didn't know how the kryo
Input class worked with buffers that were read over (for example) a socket;
if it would do partial reads such that I needed a while loop for a FULL
read.


On Tue, Jan 7, 2014 at 2:40 PM, Nathan Sweet <notifications@github.com>wrote:

> In src/com/esotericsoftware/kryo/adapters/DataInputAdapter.java:
>
> > +    protected final Input input;
> > +
> > +    public DataInputAdapter( Input input ) {
> > +        this.input = input;
> > +    }
> > +
> > +    public void readFully( byte[] b ) throws IOException {
> > +        readFully( b, 0, b.length );
> > +    }
> > +
> > +    public void readFully( byte[] b, int off, int len ) throws IOException {
> > +        if (len < 0)
> > +            throw new IndexOutOfBoundsException();
> > +
> > +        int n = 0;
> > +        while (n < len) {
>
> Note sure while is needed here.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/EsotericSoftware/kryo/pull/167/files#r8709873>
> .
>