Read a long from the constant pool.

@param cpIdx
the constant pool index.
@return the long
@throws IOException
If an I/O exception occurred.
348274
private long cpReadLong(final int cpIdx) throws IOException {
        if (cpIdx < 1 || cpIdx >= cpCount) {
            throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
                    + (cpCount - 1) + "] -- cannot continue reading class. "
                    + "Please report this at https://github.com/classgraph/classgraph/issues");
        }
        return inputStreamOrByteBuffer.readLong(entryOffset[cpIdx]);
    }
1260467
public long getVLong() {
		// org.apache.lucene.util.packed.BlockPackedReaderIterator
		long value = 0;
		for (int i = 0; i <= 64; i += 7) {
			final byte b = getByte();
			value |= ((b & 0x7FL) << i);
			if (b >= 0)
				return value;
		}
		return value;
	}
640555
protected long readUInt(InputStream in) throws IOException { // IA VISIBILITY CHANGE FOR SUBCLASS USE
        long s = readUShort(in);
        return ((long)readUShort(in) << 16) | s;
    }
1064315
public long getLongHeader(int radix, String name, long defaultValue) {
        return header.getLongValue(radix, name, defaultValue);
    }
409349
public long getOffset() throws IOException {
        if (offset == null) {
            read();
            SectionTable table = data.getSectionTable();
            SectionLoader loader = new SectionLoader(data);
            offset = 0L;
            List<SectionHeader> headers = table.getSectionHeaders();
            // TODO low alingment check instead?
//            if (headers.size() == 0) { // offset for sectionless PE's
//                offset = file.length();
//            }
            for (SectionHeader section : headers) {
                long alignedPointerToRaw = section.getAlignedPointerToRaw();
                long readSize = loader.getReadSize(section);
                // ignore invalid sections
                // corkami: "if a section starts at [unaligned] offset 0, it's invalid."
                if (readSize == 0 || section.get(SectionHeaderKey.POINTER_TO_RAW_DATA) == 0) {
                    continue;
                }
                long endPoint = readSize + alignedPointerToRaw;
                if (offset < endPoint) { // determine largest endPoint
                    offset = endPoint;
                }
            }
        }
        if (offset > file.length() || offset == 0) {
            offset = file.length();
        }
        return offset;
    }
1219257
public int read(long position, byte[] buffer, int offset, int length,
      ReadOptions options)
    throws IOException {      
    // sanity checks
    dfsClient.checkOpen();
    if (closed) {
      throw new IOException("Stream closed");
    }
    DFSClient.dfsInputStreamfailures.set(0);
			long start = System.currentTimeMillis();
    long filelen = getFileLength();
    if ((position < 0) || (position >= filelen)) {
      return -1;
    }
    int realLen = length;
    if ((position + length) > filelen) {
      realLen = (int)(filelen - position);
    }
    
    DFSReadProfilingData pData = DFSClient.getDFSReadProfilingData();

    // determine the block and byte range within the block
    // corresponding to position and realLen
    List<LocatedBlock> blockRange = getBlockRange(position, realLen);
    
    if (!tryPreadFromLocal(blockRange, position, buffer, offset, length,
        realLen, start)) {
      // non-local or multiple block read.
      int remaining = realLen;
      for (LocatedBlock blk : blockRange) {
        long targetStart = position - blk.getStartOffset();
        long bytesToRead = Math.min(remaining, blk.getBlockSize() - targetStart);
        if (dfsClient.allowParallelReads && dfsClient.parallelReadsThreadPool != null) {
          fetchBlockByteRangeSpeculative(blk, targetStart,
                              targetStart + bytesToRead - 1, buffer, offset,
                              options);
        } else {
          if (pData != null) {
            cliData = new FSClientReadProfilingData();
            pData.addDFSClientReadProfilingData(cliData);
            cliData.startRead();
          }
          
          fetchBlockByteRange(blk, targetStart,
                              targetStart + bytesToRead - 1, buffer, offset,
                              options);
          
          if (pData != null) {
            cliData.endRead();
          }
        }
        remaining -= bytesToRead;
        position += bytesToRead;
        offset += bytesToRead;
      }
      assert remaining == 0 : "Wrong number of bytes read.";
    }
    
    if (dfsClient.stats != null) {
      dfsClient.stats.incrementBytesRead(realLen);
    }
    long timeval = System.currentTimeMillis() - start;
    dfsClient.metrics.incPreadTime(timeval);
    dfsClient.metrics.incPreadSize(realLen);
    dfsClient.metrics.incPreadOps();
    return realLen;
  }
18246
def read_long(self, signed=True):
        """"""
        return int.from_bytes(self.read(8), byteorder='little', signed=signed)
19114
public static long readUnsignedIntegerLittleEndian(InputStream io) throws IOException {
		long value = io.read();
		if (value < 0) throw new EOFException();
		int i = io.read();
		if (i < 0) throw new EOFException();
		value |= i << 8;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= i << 16;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= ((long)i) << 24;
		return value;
	}
574787
int getShort(final long off) throws IOException, InterruptedException {
        if (off < 0 || off > zipFileSlice.len - 2) {
            throw new IndexOutOfBoundsException();
        }
        if (read(off, scratch, 0, 2) < 2) {
            throw new EOFException("Unexpected EOF");
        }
        return ((scratch[1] & 0xff) << 8) | (scratch[0] & 0xff);
    }
328857
public long readRawLittleEndian64() throws IOException
    {
        // final byte[] buffer = this.buffer;
        // int offset = this.offset;

        final byte[] bs = new byte[8];
        buffer.get(bs);

        // final byte b1 = buffer[offset++];
        // final byte b2 = buffer[offset++];
        // final byte b3 = buffer[offset++];
        // final byte b4 = buffer[offset++];
        // final byte b5 = buffer[offset++];
        // final byte b6 = buffer[offset++];
        // final byte b7 = buffer[offset++];
        // final byte b8 = buffer[offset++];
        //
        // this.offset = offset;

        return (((long) bs[0] & 0xff)) |
                (((long) bs[1] & 0xff) << 8) |
                (((long) bs[2] & 0xff) << 16) |
                (((long) bs[3] & 0xff) << 24) |
                (((long) bs[4] & 0xff) << 32) |
                (((long) bs[5] & 0xff) << 40) |
                (((long) bs[6] & 0xff) << 48) |
                (((long) bs[7] & 0xff) << 56);
    }
1174574
private LongConstant parseLongConstant(int index)
    throws IOException
  {
    long value = readLong();

    return new LongConstant(_class.getConstantPool(), index, value);
  }
590482
public static long readLongLittleEndian(InputStream io) throws IOException {
		long value = io.read();
		if (value < 0) throw new EOFException();
		int i = io.read();
		if (i < 0) throw new EOFException();
		value |= i << 8;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= i << 16;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= ((long)i) << 24;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= ((long)i) << 32;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= ((long)i) << 40;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= ((long)i) << 48;
		i = io.read();
		if (i < 0) throw new EOFException();
		value |= ((long)i) << 56;
		return value;
	}
58654
public final int readTTFUShort(long pos) throws IOException {
        long cp = getCurrentPos();
        seekSet(pos);
        int ret = readTTFUShort();
        seekSet(cp);
        return ret;
    }
1030647
private int cpReadUnsignedShort(final int cpIdx) throws IOException {
        if (cpIdx < 1 || cpIdx >= cpCount) {
            throw new ClassfileFormatException("Constant pool index " + cpIdx + ", should be in range [1, "
                    + (cpCount - 1) + "] -- cannot continue reading class. "
                    + "Please report this at https://github.com/classgraph/classgraph/issues");
        }
        return inputStreamOrByteBuffer.readUnsignedShort(entryOffset[cpIdx]);
    }
811528
public long readVarLong (boolean optimizePositive) throws KryoException {
		if (require(1) < 9) return readVarLong_slow(optimizePositive);
		int p = position;
		int b = buffer[p++];
		long result = b & 0x7F;
		if ((b & 0x80) != 0) {
			byte[] buffer = this.buffer;
			b = buffer[p++];
			result |= (b & 0x7F) << 7;
			if ((b & 0x80) != 0) {
				b = buffer[p++];
				result |= (b & 0x7F) << 14;
				if ((b & 0x80) != 0) {
					b = buffer[p++];
					result |= (b & 0x7F) << 21;
					if ((b & 0x80) != 0) {
						b = buffer[p++];
						result |= (long)(b & 0x7F) << 28;
						if ((b & 0x80) != 0) {
							b = buffer[p++];
							result |= (long)(b & 0x7F) << 35;
							if ((b & 0x80) != 0) {
								b = buffer[p++];
								result |= (long)(b & 0x7F) << 42;
								if ((b & 0x80) != 0) {
									b = buffer[p++];
									result |= (long)(b & 0x7F) << 49;
									if ((b & 0x80) != 0) {
										b = buffer[p++];
										result |= (long)b << 56;
									}
								}
							}
						}
					}
				}
			}
		}
		position = p;
		return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));
	}
734913
public long getKeyAsLong(int index) throws IOException {
        if (index >= structure.keySizes.size()) {
            throw new IOException("Index " + index + " is out of range.");
        }
        return Bytes.toLong(key, structure.keyByteOffsets.get(index));
    }
106438
public long readRawULong(int bits) throws IOException {
        long val = 0;
        for (int i = 0; i < bits; i++) {
            val = readBitToLong(val);
        }
        return val;
    }