static public long swapLong(byte[] b, int offset) {
    // 8 bytes
    long accum = 0;
    long shiftedval;
    for (int shiftBy = 0, i = offset; shiftBy < 64; shiftBy += 8, i++) {
      shiftedval = ((long) (b[i] & 0xff)) << shiftBy;
      accum |= shiftedval;
    }
    return accum;
  }
static public long swapLong(byte[] b, int offset) {
    
    long accum = 0;
    long shiftedval;
    for (int shiftBy = 0, i = offset; shiftBy < 64; shiftBy += 8, i++) {
      shiftedval = ((long) (b[i] & 0xff)) << shiftBy;
      accum |= shiftedval;
    }
    return accum;
  }
static public long swapLong ( byte [ ] b , int offset ) { // 8 bytes long accum = 0 ; long shiftedval ; for ( int shiftBy = 0 , i = offset ; shiftBy < 64 ; shiftBy += 8 , i ++ ) { shiftedval = ( ( long ) ( b [ i ] & 0xff ) ) << shiftBy ; accum |= shiftedval ; } return accum ; }
Returns the long resulting from reversing 8 bytes at a specified
offset in a byte array.

@param b      the byte array
@param offset the offset of the first byte
@return the long represented by the bytes
<code>b[offset+7], b[offset+6], ..., b[offset]</code>
Returns the long resulting from reversing 8 bytes at a specified offset in a byte array .