Reads an 8 byte long.
340956
public long readLong () throws KryoException {
		require(8);
		byte[] buffer = this.buffer;
		int p = position;
		position = p + 8;
		return buffer[p] & 0xFF //
			| (buffer[p + 1] & 0xFF) << 8 //
			| (buffer[p + 2] & 0xFF) << 16 //
			| (long)(buffer[p + 3] & 0xFF) << 24 //
			| (long)(buffer[p + 4] & 0xFF) << 32 //
			| (long)(buffer[p + 5] & 0xFF) << 40 //
			| (long)(buffer[p + 6] & 0xFF) << 48 //
			| (long)buffer[p + 7] << 56;
	}
344966
public static ByteBuf copyLong(long value) {
        ByteBuf buf = buffer(8);
        buf.writeLong(value);
        return buf;
    }
487823
public byte read() throws IOException {
        if (current >= fsize) {
            throw new java.io.EOFException("Reached EOF, file size=" + fsize);
        }

        final byte ret = file[current++];
        return ret;
    }
621137
public long[] readLongs (int length) throws KryoException {
		long[] array = new long[length];
		if (optional(length << 3) == length << 3) {
			byte[] buffer = this.buffer;
			int p = this.position;
			for (int i = 0; i < length; i++, p += 8) {
				array[i] = buffer[p] & 0xFF //
					| (buffer[p + 1] & 0xFF) << 8 //
					| (buffer[p + 2] & 0xFF) << 16 //
					| (long)(buffer[p + 3] & 0xFF) << 24 //
					| (long)(buffer[p + 4] & 0xFF) << 32 //
					| (long)(buffer[p + 5] & 0xFF) << 40 //
					| (long)(buffer[p + 6] & 0xFF) << 48 //
					| (long)buffer[p + 7] << 56;
			}
			position = p;
		} else {
			for (int i = 0; i < length; i++)
				array[i] = readLong();
		}
		return array;
	}
468704
public static long readLong(ArrayView source, int position) {
        return (long) (source.get(position) & 0xFF) << 56
                | (long) (source.get(position + 1) & 0xFF) << 48
                | (long) (source.get(position + 2) & 0xFF) << 40
                | (long) (source.get(position + 3) & 0xFF) << 32
                | (long) (source.get(position + 4) & 0xFF) << 24
                | (source.get(position + 5) & 0xFF) << 16
                | (source.get(position + 6) & 0xFF) << 8
                | (source.get(position + 7) & 0xFF);
    }
253762
public static final long readLong(byte[] array, int offset)
    {
        if (array.length < offset + 8)
        {
            throw new IllegalArgumentException("no room in array");
        }
        return
                (((long)array[offset]<<56) & 0xff00000000000000L) +
                (((long)array[offset + 1]<<48) & 0xff000000000000L)  +
                (((long)array[offset + 2]<<40) & 0xff0000000000L)  +
                (((long)array[offset + 3]<<32) & 0xff00000000L)  +
                (((long)array[offset + 4]<<24) & 0xff000000L)  +
                (((long)array[offset + 5]<<16) & 0xff0000L)  +
                (((long)array[offset + 6]<<8) & 0xff00L)  +
                ((long)array[offset + 7] & 0xff );
    }
1106877
@Override
    public int read() throws IOException {
        int r = read(singleByte, 0, 1);
        while (r == 0) {
            r = read(singleByte, 0, 1);
        }
        if (r > 0) {
            final byte b = singleByte[0];
            return b < 0 ? 256 + b : b;
        }
        return EOF;
    }
1012878
public static long byteArrayToLongBE( byte[] data ) {
        if (data == null)
            return 0x0;
        long accum = 0;
        int shiftBy = 8 * data.length - 8;
        for( byte b : data ) {
            accum |= (long) (0xff & b) << shiftBy;
            shiftBy -= 8;
        }
        return accum;
    }
728638
public static long fromBytes(byte[] value){
        if (value == null) return 0;
        long out = 0;
        int length = value.length;
        if (length > 8) length = 8;
        for (int i = 0; i < length; i++){
            out = (out << 8) + (value[i] & 0xff);
        }
        return out;
    }
348780
public final long readTTFULong() throws IOException {
        long ret = readTTFUByte();
        ret = (ret << 8) + readTTFUByte();
        ret = (ret << 8) + readTTFUByte();
        ret = (ret << 8) + readTTFUByte();

        return ret;
    }
1265729
def _long_to_bytes(n, length, byteorder):
    
    if byteorder == 'little':
        indexes = range(length)
    else:
        indexes = reversed(range(length))
    return bytearray((n >> i * 8) & 0xff for i in indexes)
1275505
public static short readShort(byte b[], int offset) {
    int retValue;

    retValue = b[offset++] << 8;
    retValue |= b[offset] & 0xff;

    return (short)retValue;
  }
757044
private int parseByte()
        throws IOException
    {
        while (_chunkLength <= 0) {
            if (_isLastChunk) {
                return -1;
            }

            int code = read();

            switch (code) {
                case 'b':
                    _isLastChunk = false;

                    _chunkLength = (read() << 8) + read();
                    break;

                case 'B':
                    _isLastChunk = true;

                    _chunkLength = (read() << 8) + read();
                    break;

                default:
                    throw expect("byte[]", code);
            }
        }

        _chunkLength--;

        return read();
    }
811578
public static long readLong(byte b[], int offset) {
    long retValue;

    retValue = ((long)b[offset++]) << 56;
    retValue |= ((long)b[offset++] & 0xff) << 48;
    retValue |= ((long)b[offset++] & 0xff) << 40;
    retValue |= ((long)b[offset++] & 0xff) << 32;
    retValue |= ((long)b[offset++] & 0xff) << 24;
    retValue |= ((long)b[offset++] & 0xff) << 16;
    retValue |= ((long)b[offset++] & 0xff) << 8;
    retValue |= (long)b[offset] & 0xff;

    return retValue;
  }
99136
public static long readUnsignedLong(ObjectInput in) throws IOException {
      byte b = in.readByte();
      long i = b & 0x7F;
      for (int shift = 7; (b & 0x80) != 0; shift += 7) {
         b = in.readByte();
         i |= (b & 0x7FL) << shift;
      }
      return i;
   }
1167387
public int readShort()
    throws IOException
  {
    int c1 = _is.read();
    int c2 = _is.read();

    return ((c1 << 8) | c2);
  }
889212
@Override
	public int read(byte[] b, int off, int len) throws IOException {
		if (currentEntry != null) {
			if (currentFileSize == currentEntry.getSize()) {
				return -1;
			} else if ((currentEntry.getSize() - currentFileSize) < len) {
				len = (int) (currentEntry.getSize() - currentFileSize);
			}
		}

		int br = super.read(b, off, len);

		if (br != -1) {
			if (currentEntry != null) {
				currentFileSize += br;
			}

			bytesRead += br;
		}

		return br;
	}