Android Byte Array to Long Convert makeLong(byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1, byte b0)

Here you can find the source of makeLong(byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1, byte b0)

Description

make Long

Declaration

static private long makeLong(byte b7, byte b6, byte b5, byte b4,
            byte b3, byte b2, byte b1, byte b0) 

Method Source Code

//package com.java2s;

public class Main {
    static private long makeLong(byte b7, byte b6, byte b5, byte b4,
            byte b3, byte b2, byte b1, byte b0) {
        return ((((long) b7 & 0xff) << 56) | (((long) b6 & 0xff) << 48)
                | (((long) b5 & 0xff) << 40) | (((long) b4 & 0xff) << 32)
                | (((long) b3 & 0xff) << 24) | (((long) b2 & 0xff) << 16)
                | (((long) b1 & 0xff) << 8) | (((long) b0 & 0xff) << 0));
    }/*  w w  w . j a  v a 2s.  c o m*/
}

Related

  1. getLongFromByteArray(final byte[] bytes)
  2. toLong(byte[] b, int pos)
  3. toLong(byte[] b, int pos, int width)
  4. toLong(byte[] src)
  5. toLong(byte[] src, int srcPos)
  6. getLong(byte[] src, boolean bigEndin)
  7. uint16ToLong(byte[] buf, int offset)
  8. uint32ToLong(byte[] buf, int offset)
  9. uint64ToLong(byte[] buf, int offset)