mirror of
https://github.com/corda/corda.git
synced 2025-01-23 04:48:09 +00:00
implement ByteBuffer.getInt(int)
This commit is contained in:
parent
297e8f09ec
commit
86dfaf9ff0
@ -149,6 +149,16 @@ public class ByteBuffer extends Buffer implements Comparable<ByteBuffer> {
|
|||||||
return array[arrayOffset+position];
|
return array[arrayOffset+position];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getInt(int position) {
|
||||||
|
checkGet(position, 4);
|
||||||
|
|
||||||
|
int p = arrayOffset + position;
|
||||||
|
return ((array[p] & 0xFF) << 24)
|
||||||
|
| ((array[p + 1] & 0xFF) << 16)
|
||||||
|
| ((array[p + 2] & 0xFF) << 8)
|
||||||
|
| ((array[p + 3] & 0xFF));
|
||||||
|
}
|
||||||
|
|
||||||
public int getInt() {
|
public int getInt() {
|
||||||
checkGet(4);
|
checkGet(4);
|
||||||
int i = get() << 24;
|
int i = get() << 24;
|
||||||
|
Loading…
Reference in New Issue
Block a user