implement ByteBuffer.get(byte[])

This commit is contained in:
Joel Dice 2007-11-09 14:32:33 -07:00
parent 7b8fb7233e
commit d1048f9bcb

View File

@ -138,7 +138,6 @@ public class ByteBuffer {
return this;
}
public boolean hasRemaining() {
return remaining() > 0;
}
@ -148,6 +147,17 @@ public class ByteBuffer {
return array[arrayOffset+(position++)];
}
public ByteBuffer get(byte[] dst) {
return get(dst, 0, dst.length);
}
public ByteBuffer get(byte[] dst, int offset, int length) {
checkGet(length);
System.arraycopy(array, arrayOffset + position, dst, offset, length);
position += length;
return this;
}
public byte get(int position) {
checkGet(position, 1);
return array[arrayOffset+position];