public final long peekLong(int offset, ByteOrder order) { return Memory.peekLong(address + offset, order.needsSwap); }
private static UUID makeUuid(byte[] hash, int version) { long msb = Memory.peekLong(hash, 0, ByteOrder.BIG_ENDIAN); long lsb = Memory.peekLong(hash, 8, ByteOrder.BIG_ENDIAN); // Set the version field. msb &= ~(0xfL << 12); msb |= ((long) version) << 12; // Set the variant field to 2. Note that the variant field is variable-width, // so supporting other variants is not just a matter of changing the constant 2 below! lsb &= ~(0x3L << 62); lsb |= 2L << 62; return new UUID(msb, lsb); }
/** * Reads a big-endian 64-bit long from the current position in this file. Blocks until * eight bytes have been read, the end of the file is reached or an * exception is thrown. * * @return the next long value from this file. * @throws EOFException * if the end of this file is detected. * @throws IOException * if this file is closed or another I/O error occurs. * @see #writeLong(long) */ public final long readLong() throws IOException { readFully(scratch, 0, SizeOf.LONG); return Memory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN); }
@Override public final long getLong() { int newPosition = position + SizeOf.LONG; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = Memory.peekLong(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final long getLong(int index) { checkIndex(index, SizeOf.LONG); return Memory.peekLong(backingArray, arrayOffset + index, order); }
public final long readLong() throws IOException { Streams.readFully(in, scratch, 0, SizeOf.LONG); return Memory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN); }
return Memory.peekLong(hash, 0, ByteOrder.LITTLE_ENDIAN);
private static UUID makeUuid(byte[] hash, int version) { long msb = Memory.peekLong(hash, 0, ByteOrder.BIG_ENDIAN); long lsb = Memory.peekLong(hash, 8, ByteOrder.BIG_ENDIAN); // Set the version field. msb &= ~(0xfL << 12); msb |= ((long) version) << 12; // Set the variant field to 2. Note that the variant field is variable-width, // so supporting other variants is not just a matter of changing the constant 2 below! lsb &= ~(0x3L << 62); lsb |= 2L << 62; return new UUID(msb, lsb); }
private static UUID makeUuid(byte[] hash, int version) { long msb = Memory.peekLong(hash, 0, ByteOrder.BIG_ENDIAN); long lsb = Memory.peekLong(hash, 8, ByteOrder.BIG_ENDIAN); // Set the version field. msb &= ~(0xfL << 12); msb |= ((long) version) << 12; // Set the variant field to 2. Note that the variant field is variable-width, // so supporting other variants is not just a matter of changing the constant 2 below! lsb &= ~(0x3L << 62); lsb |= 2L << 62; return new UUID(msb, lsb); }
private static UUID makeUuid(byte[] hash, int version) { long msb = Memory.peekLong(hash, 0, false); long lsb = Memory.peekLong(hash, 8, false); // Set the version field. msb &= ~(0xfL << 12); msb |= ((long) version) << 12; // Set the variant field to 2. Note that the variant field is variable-width, // so supporting other variants is not just a matter of changing the constant 2 below! lsb &= ~(0x3L << 62); lsb |= 2L << 62; return new UUID(msb, lsb); }
private static UUID makeUuid(byte[] hash, int version) { long msb = Memory.peekLong(hash, 0, ByteOrder.BIG_ENDIAN); long lsb = Memory.peekLong(hash, 8, ByteOrder.BIG_ENDIAN); // Set the version field. msb &= ~(0xfL << 12); msb |= ((long) version) << 12; // Set the variant field to 2. Note that the variant field is variable-width, // so supporting other variants is not just a matter of changing the constant 2 below! lsb &= ~(0x3L << 62); lsb |= 2L << 62; return new UUID(msb, lsb); }
private static UUID makeUuid(byte[] hash, int version) { long msb = Memory.peekLong(hash, 0, ByteOrder.BIG_ENDIAN); long lsb = Memory.peekLong(hash, 8, ByteOrder.BIG_ENDIAN); // Set the version field. msb &= ~(0xfL << 12); msb |= ((long) version) << 12; // Set the variant field to 2. Note that the variant field is variable-width, // so supporting other variants is not just a matter of changing the constant 2 below! lsb &= ~(0x3L << 62); lsb |= 2L << 62; return new UUID(msb, lsb); }
@Override public final long getLong() { int newPosition = position + SizeOf.LONG; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = Memory.peekLong(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final long getLong() { int newPosition = position + SizeOf.LONG; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = Memory.peekLong(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final long getLong() { int newPosition = position + SizeOf.LONG; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = Memory.peekLong(backingArray, arrayOffset + position, order); position = newPosition; return result; }
@Override public final long getLong() { int newPosition = position + SizeOf.LONG; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = Memory.peekLong(backingArray, arrayOffset + position, order); position = newPosition; return result; }
public final long readLong() throws IOException { Streams.readFully(in, scratch, 0, SizeOf.LONG); return Memory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN); }
public final long readLong() throws IOException { Streams.readFully(in, scratch, 0, SizeOf.LONG); return Memory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN); }
@Override public final long getLong(int index) { checkIndex(index, SizeOf.LONG); return Memory.peekLong(backingArray, arrayOffset + index, order); }
@Override public final long getLong() { int newPosition = position + SizeOf.LONG; if (newPosition > limit) { throw new BufferUnderflowException(); } long result = Memory.peekLong(backingArray, arrayOffset + position, order); position = newPosition; return result; }