private static long byteArrayToLong(byte[] buffer,
                                       int nStartIndex)
    {
        return (((long)buffer[nStartIndex]) << 56) |
                (((long)buffer[nStartIndex + 1] & 0x0ffL) << 48) |
                (((long)buffer[nStartIndex + 2] & 0x0ffL) << 40) |
                (((long)buffer[nStartIndex + 3] & 0x0ffL) << 32) |
                (((long)buffer[nStartIndex + 4] & 0x0ffL) << 24) |
                (((long)buffer[nStartIndex + 5] & 0x0ffL) << 16) |
                (((long)buffer[nStartIndex + 6] & 0x0ffL) << 8) |
                ((long)buffer[nStartIndex + 7] & 0x0ff);
    }
gets bytes from an array into a long
@param buffer where to get the bytes
@param nStartIndex index from where to read the data
@return the 64bit integer
xmppserver/src/main/java/org/jivesoftware/util/Blowfish.java