@Override public short getUint8(int byteOffset) { return Uint8ArrayNative.create(buffer, byteOffset, 1).get(0); }
/** * Copy bytes from the underlying buffer to a temporary buffer, reversing them * in the process. * * @param src * @param srcOfs offset into {@code buffer} * @param len number of bytes to copy * @param dest * @param destOfs */ protected final void reverseBytes(Uint8ArrayNative src, int srcOfs, int len, Uint8ArrayNative dest, int destOfs) { for (int i = 0; i < len; ++i) { dest.set(i + destOfs, src.get(srcOfs + len - 1 - i)); } } }
@Override public byte getByte() { if (Debug.ENABLED) Debug.assertion(_position < _limit); if (_useTypedArrays) return (byte) _typed.get(_position++); return _array[_position++]; }
@Override public void getImmutably(byte[] bytes, int offset, int length) { if (length > remaining()) throw new RuntimeException(); if (_useTypedArrays) { for (int i = 0; i < length; i++) bytes[offset + i] = (byte) _typed.get(_position + i); } else System.arraycopy(_array, _position, bytes, offset, length); }
@Override public short getUint8(int byteOffset) { return Uint8ArrayNative.create(buffer, byteOffset, 1).get(0); }
@Override public short getUint8(int byteOffset) { return Uint8ArrayNative.create(buffer, byteOffset, 1).get(0); }
/** * Copy bytes from the underlying buffer to a temporary buffer, reversing them * in the process. * * @param src * @param srcOfs offset into {@code buffer} * @param len number of bytes to copy * @param dest * @param destOfs */ protected final void reverseBytes(Uint8ArrayNative src, int srcOfs, int len, Uint8ArrayNative dest, int destOfs) { for (int i = 0; i < len; ++i) { dest.set(i + destOfs, src.get(srcOfs + len - 1 - i)); } } }
/** * Copy bytes from the underlying buffer to a temporary buffer, reversing them * in the process. * * @param src * @param srcOfs offset into {@code buffer} * @param len number of bytes to copy * @param dest * @param destOfs */ protected final void reverseBytes(Uint8ArrayNative src, int srcOfs, int len, Uint8ArrayNative dest, int destOfs) { for (int i = 0; i < len; ++i) { dest.set(i + destOfs, src.get(srcOfs + len - 1 - i)); } } }