DataInput#read() should return -1 when the end of buffer is reached

The method DataInput2#read() should return -1 when there's no more data.