Android Byte Array to Long Convert getLong(byte[] bb, int index)

Here you can find the source of getLong(byte[] bb, int index)

Description

get Long

Declaration

public static long getLong(byte[] bb, int index) 

Method Source Code

//package com.java2s;

public class Main {

    public static long getLong(byte[] bb, int index) {
        return ((((long) bb[index + 7] & 0xff) << 56)
                | (((long) bb[index + 6] & 0xff) << 48)
                | (((long) bb[index + 5] & 0xff) << 40)
                | (((long) bb[index + 4] & 0xff) << 32)
                | (((long) bb[index + 3] & 0xff) << 24)
                | (((long) bb[index + 2] & 0xff) << 16)
                | (((long) bb[index + 1] & 0xff) << 8) | (((long) bb[index + 0] & 0xff) << 0));
    }//from  w ww.j  a  v  a 2s  . c  o  m
}

Related

  1. bytesToLong(byte[] bytes)
  2. bytesToLong(byte[] bytes)
  3. bytesToLong(byte[] bytes, int start)
  4. bytes2ulong(byte[] bytes, int from, int to)
  5. getLong(byte[] bb, int index)
  6. getLong(byte[] buf, boolean bigEndian)
  7. getLong(byte[] buf, int pos, boolean bigEndian)
  8. getLong(byte[] bytes)
  9. getLong4(byte[] b, int offset)