/** * Reads a double-precision floating point value (64bit, 8 bytes) from the given position, in big endian * byte order. This method's speed depends on the system's native byte order, and it * is possibly slower than {@link #getDouble(int)}. For most cases (such as * transient storage in memory or serialization for I/O and network), * it suffices to know that the byte order in which the value is written is the same as the * one in which it is read, and {@link #getDouble(int)} is the preferable choice. * * @param index The position from which the value will be read. * @return The long value at the given position. * * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segment * size minus 8. */ public final double getDoubleBigEndian(int index) { return Double.longBitsToDouble(getLongBigEndian(index)); }
long l1 = this.getLongBigEndian(offset1); long l2 = seg2.getLongBigEndian(offset2);
long r = segment.getLongBigEndian(pos); assertEquals(val, Long.reverseBytes(r));
@Override public final long readLong() throws IOException { final long v = this.segment.getLongBigEndian(this.position); this.position += 8; return v; }
@Override public final long readLong() throws IOException { final long v = this.segment.getLongBigEndian(this.position); this.position += 8; return v; }
@Override public final long readLong() throws IOException { final long v = this.segment.getLongBigEndian(this.position); this.position += 8; return v; }
@Override public final long readLong() throws IOException { final long v = this.segment.getLongBigEndian(this.position); this.position += 8; return v; }
@Override public final long readLong() throws IOException { final long v = this.segment.getLongBigEndian(this.position); this.position += 8; return v; }
@Override protected long _getLong(int index) { return memorySegment.getLongBigEndian(index); }
@Override protected long _getLong(int index) { return memorySegment.getLongBigEndian(index); }
@Override protected long _getLong(int index) { return memorySegment.getLongBigEndian(index); }
/** * Reads a double-precision floating point value (64bit, 8 bytes) from the given position, in big endian * byte order. This method's speed depends on the system's native byte order, and it * is possibly slower than {@link #getDouble(int)}. For most cases (such as * transient storage in memory or serialization for I/O and network), * it suffices to know that the byte order in which the value is written is the same as the * one in which it is read, and {@link #getDouble(int)} is the preferable choice. * * @param index The position from which the value will be read. * @return The long value at the given position. * * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segment * size minus 8. */ public final double getDoubleBigEndian(int index) { return Double.longBitsToDouble(getLongBigEndian(index)); }
/** * Reads a double-precision floating point value (64bit, 8 bytes) from the given position, in big endian * byte order. This method's speed depends on the system's native byte order, and it * is possibly slower than {@link #getDouble(int)}. For most cases (such as * transient storage in memory or serialization for I/O and network), * it suffices to know that the byte order in which the value is written is the same as the * one in which it is read, and {@link #getDouble(int)} is the preferable choice. * * @param index The position from which the value will be read. * @return The long value at the given position. * * @throws IndexOutOfBoundsException Thrown, if the index is negative, or larger then the segment * size minus 8. */ public final double getDoubleBigEndian(int index) { return Double.longBitsToDouble(getLongBigEndian(index)); }
long l1 = this.getLongBigEndian(offset1); long l2 = seg2.getLongBigEndian(offset2);
long l1 = this.getLongBigEndian(offset1); long l2 = seg2.getLongBigEndian(offset2);
@Override public long readLong() throws IOException { if (this.positionInSegment < this.limitInSegment - 7) { final long v = this.currentSegment.getLongBigEndian(this.positionInSegment); this.positionInSegment += 8; return v; } else if (this.positionInSegment == this.limitInSegment) { advance(); return readLong(); } else { long l = 0L; l |= ((long) readUnsignedByte()) << 56; l |= ((long) readUnsignedByte()) << 48; l |= ((long) readUnsignedByte()) << 40; l |= ((long) readUnsignedByte()) << 32; l |= ((long) readUnsignedByte()) << 24; l |= ((long) readUnsignedByte()) << 16; l |= ((long) readUnsignedByte()) << 8; l |= (long) readUnsignedByte(); return l; } }
@Override public long readLong() throws IOException { if (this.positionInSegment < this.limitInSegment - 7) { final long v = this.currentSegment.getLongBigEndian(this.positionInSegment); this.positionInSegment += 8; return v; } else if (this.positionInSegment == this.limitInSegment) { advance(); return readLong(); } else { long l = 0L; l |= ((long) readUnsignedByte()) << 56; l |= ((long) readUnsignedByte()) << 48; l |= ((long) readUnsignedByte()) << 40; l |= ((long) readUnsignedByte()) << 32; l |= ((long) readUnsignedByte()) << 24; l |= ((long) readUnsignedByte()) << 16; l |= ((long) readUnsignedByte()) << 8; l |= (long) readUnsignedByte(); return l; } }
@Override public long readLong() throws IOException { if (this.positionInSegment < this.limitInSegment - 7) { final long v = this.currentSegment.getLongBigEndian(this.positionInSegment); this.positionInSegment += 8; return v; } else if (this.positionInSegment == this.limitInSegment) { advance(); return readLong(); } else { long l = 0L; l |= ((long) readUnsignedByte()) << 56; l |= ((long) readUnsignedByte()) << 48; l |= ((long) readUnsignedByte()) << 40; l |= ((long) readUnsignedByte()) << 32; l |= ((long) readUnsignedByte()) << 24; l |= ((long) readUnsignedByte()) << 16; l |= ((long) readUnsignedByte()) << 8; l |= (long) readUnsignedByte(); return l; } }
@Override public long readLong() throws IOException { if (this.positionInSegment < this.limitInSegment - 7) { final long v = this.currentSegment.getLongBigEndian(this.positionInSegment); this.positionInSegment += 8; return v; } else if (this.positionInSegment == this.limitInSegment) { advance(); return readLong(); } else { long l = 0L; l |= ((long) readUnsignedByte()) << 56; l |= ((long) readUnsignedByte()) << 48; l |= ((long) readUnsignedByte()) << 40; l |= ((long) readUnsignedByte()) << 32; l |= ((long) readUnsignedByte()) << 24; l |= ((long) readUnsignedByte()) << 16; l |= ((long) readUnsignedByte()) << 8; l |= (long) readUnsignedByte(); return l; } }