Java Byte Array to Long bytesToLong(byte[] data, int offset)

Here you can find the source of bytesToLong(byte[] data, int offset)

Description

bytes To Long

License

Apache License

Parameter

Parameter Description
data a parameter
offset a parameter

Declaration

public static long bytesToLong(byte[] data, int offset) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//www.  j a v  a  2s .  c  om
     * 
     * @param data
     * @param offset
     * @return
     */
    public static long bytesToLong(byte[] data, int offset) {
        long num = 0;
        for (int i = offset; i < offset + 8; i++) {
            num <<= 8;
            num |= (data[i] & 0xff);
        }
        return num;
    }
}

Related

  1. bytesToLong(byte[] bytes, int off)
  2. bytesToLong(byte[] bytes, int off, boolean bigEndian)
  3. bytesToLong(byte[] data)
  4. bytesToLong(byte[] data)
  5. bytesToLong(byte[] data)
  6. bytesToLong(byte[] inbytes, int shift)
  7. bytesToLong(byte[] longBytes)
  8. bytesToLong(byte[] p, int offset)
  9. bytesToLong(final byte[] b)