code: public static long getBytesLongValue(byte[] bytes, int offset, int length) {
          assert length <= 8 && length > 0;
          assert bytes != null && bytes.length >= length + offset;
          byte[] value = Arrays.copyOfRange(bytes, offset, offset + length);
          return bytesToLong(value);
      }
docs: Retrieves the long value of a subarray of bytes.
  <p>
  The values are considered little endian. The subarray is determined by
  offset and length.
  <p>
  Presumes the byte array to be not null and its length should be between 1
  and 8 inclusive. The length of bytes must be larger than or equal to
  length + offset.
  
  @param bytes
  the little endian byte array that shall be converted to long
  @param offset
  the index to start reading the long value from
  @param length
  the number of bytes used to convert to long
  @return long value