public static long convertLongFromBytes(byte[] bytes, int offset) {
        // Convert it to a long
        return    ((((long) bytes[offset+7]) & 0xFF) 
                + ((((long) bytes[offset+6]) & 0xFF) << 8)
                + ((((long) bytes[offset+5]) & 0xFF) << 16)
                + ((((long) bytes[offset+4]) & 0xFF) << 24)
                + ((((long) bytes[offset+3]) & 0xFF) << 32)
                + ((((long) bytes[offset+2]) & 0xFF) << 40)
                + ((((long) bytes[offset+1]) & 0xFF) << 48) 
                + ((((long) bytes[offset+0]) & 0xFF) << 56));
    }
Read in a long from an InputStream

@param inputStream
           The InputStream used to read the long
@return A long, which is the next 8 bytes converted from the InputStream
@throws IOException
            Thrown if there is a problem reading from the InputStream
jme3-core/src/plugins/java/com/jme3/export/binary/ByteUtils.java