mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
implement ByteBuffer.get(byte[])
This commit is contained in:
parent
7b8fb7233e
commit
d1048f9bcb
@ -138,7 +138,6 @@ public class ByteBuffer {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean hasRemaining() {
|
public boolean hasRemaining() {
|
||||||
return remaining() > 0;
|
return remaining() > 0;
|
||||||
}
|
}
|
||||||
@ -148,6 +147,17 @@ public class ByteBuffer {
|
|||||||
return array[arrayOffset+(position++)];
|
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) {
|
public byte get(int position) {
|
||||||
checkGet(position, 1);
|
checkGet(position, 1);
|
||||||
return array[arrayOffset+position];
|
return array[arrayOffset+position];
|
||||||
|
Loading…
Reference in New Issue
Block a user