This method reads a six byte long from the input array.

@param data the input array
@param offset offset of integer data in the array
@return integer value
559266
public static final long getLong6(byte[] data, int offset)
   {
      long result = 0;
      int i = offset;
      for (int shiftBy = 0; shiftBy < 48; shiftBy += 8)
      {
         result |= ((long) (data[i] & 0xff)) << shiftBy;
         ++i;
      }
      return result;
   }
1041552
public static int readUnsignedInt(byte[] bytes, int offset) {
      byte b = bytes[offset++];
      int i = b & 0x7F;
      for (int shift = 7; (b & 0x80) != 0; shift += 7) {
         b = bytes[offset++];
         i |= (b & 0x7FL) << shift;
      }
      return i;
   }
333567
public static final String getString(byte[] data, int offset)
   {
      return getString(data, offset, data.length - offset);
   }
1029462
synchronized int read(byte[] data) {
        this.header = getHeaderParser().setData(data).parseHeader();
        if (data != null) {
            setData(header, data);
        }

        return status;
    }
173001
public int readUTF8ByByteLength(char []buffer, int offset, int byteLength)
    throws IOException
  {
    int k = 0;
    for (int i = 0; i < byteLength; i++) {
      if (_readLength <= _readOffset) {
        readBuffer();
      }

      int ch = _readBuffer[_readOffset++] & 0xff;

      if (ch < 0x80) {
        buffer[k++] = (char) ch;
      }
      else if ((ch & 0xe0) == 0xc0) {
        int c2 = read();
        i += 1;
        buffer[k++] = (char) (((ch & 0x1f) << 6) + (c2 & 0x3f));
      }
      else {
        int c2 = read();
        int c3 = read();

        i += 2;
        buffer[k++] = (char) (((ch & 0x1f) << 12)
                              + ((c2 & 0x3f) << 6)
                              + ((c3 & 0x3f)));
      }
    }

    return k;
  }
835792
public static long bytes_to_long(byte[] bytes, int offset) {
		if(bytes.length-offset<8)
			throw new PickleException("too few bytes to convert to long");
		long i = bytes[7+offset] & 0xff;
		i <<= 8;
		i |= bytes[6+offset] & 0xff;
		i <<= 8;
		i |= bytes[5+offset] & 0xff;
		i <<= 8;
		i |= bytes[4+offset] & 0xff;
		i <<= 8;
		i |= bytes[3+offset] & 0xff;
		i <<= 8;
		i |= bytes[2+offset] & 0xff;
		i <<= 8;
		i |= bytes[1+offset] & 0xff;
		i <<= 8;
		i |= bytes[offset] & 0xff;
		return i;
	}
236820
protected String getString(byte[] data, int offset) {
        if (offset < 0) {
            return "";
        }

        int i = offset;
        while (data[i++] != 0x00) {
            ;
        }
        return getString(data, offset, i - offset - 1);
    }
729095
public static String data(byte[] data, int offset, int length) {
        InputStream in = null;
        try {
            in = new ByteArrayInputStream(data, offset, length);
            return stream(in, length);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (in != null) {
                try {
                    in.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
        // never reach
        return null;
    }
1095911
static long toLong(final byte[] buffer, final int offset) {
        final long value1 = toInt(buffer, offset);
        final long value2 = toInt(buffer, offset + 4);
        return (value1 << 32) + ((value2 << 32) >>> 32);
    }
749980
private static long byteArrayToLong(byte[] ba, int offset) {
		long l = 0;

		for (int i = 0; i < SIZE_OF_LONG; ++i) {
			l |= (ba[offset + SIZE_OF_LONG - 1 - i] & 0xffL) << (i << 3);
		}

		return l;
	}
665404
public static final Date getTimestampFromTenths(byte[] data, int offset)
   {
      long ms = ((long) getInt(data, offset)) * 6000;
      return (DateHelper.getTimestampFromLong(EPOCH + ms));
   }
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 );
    }
217974
public int readUnsignedShort(final int offset) throws IOException {
        final int bytesToRead = Math.max(0, offset + 2 - used);
        if (bytesToRead > 0) {
            readMore(bytesToRead);
        }
        return ((buf[offset] & 0xff) << 8) //
                | (buf[offset + 1] & 0xff);
    }
424140
public static byte[] readBytes(byte b[], int offset, int length) {
    byte[] retValue = new byte[length];
    System.arraycopy(b, offset, retValue, 0, length);
    return retValue;
  }
697145
public static long getLongLE(final byte[] array, final int offset) {
    return  ( array[offset    ] & 0XFFL       )
          | ((array[offset + 1] & 0XFFL) <<  8)
          | ((array[offset + 2] & 0XFFL) << 16)
          | ((array[offset + 3] & 0XFFL) << 24)
          | ((array[offset + 4] & 0XFFL) << 32)
          | ((array[offset + 5] & 0XFFL) << 40)
          | ((array[offset + 6] & 0XFFL) << 48)
          | ((array[offset + 7] & 0XFFL) << 56);
  }
859076
private long toLong(byte[] data)
    {
        if (data == null || data.length != 8)
            return 0x0;
        // ----------
        return (long) (
        // (Below) convert to longs before shift because digits
        // are lost with ints beyond the 32-bit limit
        (long) (0xff & data[0]) << 56 | (long) (0xff & data[1]) << 48 | (long) (0xff & data[2]) << 40
                | (long) (0xff & data[3]) << 32 | (long) (0xff & data[4]) << 24 | (long) (0xff & data[5]) << 16
                | (long) (0xff & data[6]) << 8 | (long) (0xff & data[7]) << 0);
    }
255030
@Override
  public long readLong() throws IOException {
    byte[] longBytes = new byte[8];
    int i = in.read(longBytes);
    if (i < 8) {
      throw new EOFException();
    }
    longBytes[0] = (byte) (longBytes[0] ^ 0x80);

    long value = 0;
    for (int j = 0; j < longBytes.length; ++j) {
      value = (value << 8) + (longBytes[j] & 0xff);
    }
    return value;
  }