Android Byte Array to Long Convert byteArrayToLong(byte[] b)

Here you can find the source of byteArrayToLong(byte[] b)

Description

byte Array To Long

Declaration

public static final long byteArrayToLong(byte[] b) 

Method Source Code

//package com.java2s;

public class Main {
    public static final long byteArrayToLong(byte[] b) {
        return (long) (b[0] << 56) + ((long) (b[1] & 0xFF) << 48)
                + ((long) (b[2] & 0xFF) << 40)
                + ((long) (b[3] & 0xFF) << 32)
                + ((long) (b[4] & 0xFF) << 24)
                + ((long) (b[5] & 0xFF) << 16)
                + ((long) (b[6] & 0xFF) << 8) + ((long) b[7] & 0xFF);
    }/*w ww  . j a  v  a2 s . c o  m*/
}

Related

  1. toLong(byte[] in)
  2. parseLong(byte[] b, int start, int end, int radix)
  3. parseLong(byte[] b, int start, int end)
  4. bytes2long(byte[] b)
  5. byteArrayToLong(byte[] arr)
  6. byteArrayToLong(byte[] bArray)
  7. bytesBE2long(byte[] b, int off)
  8. bytesBE2longs(byte[] b)
  9. byteToLong(byte[] b)