Android Byte Array to Long Convert getLong4(byte[] b, int offset)

Here you can find the source of getLong4(byte[] b, int offset)

Description

get Long

Declaration

public static long getLong4(byte[] b, int offset) 

Method Source Code

//package com.java2s;

public class Main {

    public static long getLong4(byte[] b, int offset) {
        long ret = (b[offset] & 0xffL) << 24;
        ret += ((b[offset + 1] & 0xffL) << 16);
        ret += ((b[offset + 2] & 0xffL) << 8);
        ret += (b[offset + 3] & 0xffL);
        return ret;
    }/*from  w w  w . j  av a2 s . c  om*/
}

Related

  1. getLong(byte[] bb, int index)
  2. getLong(byte[] bb, int index)
  3. getLong(byte[] buf, boolean bigEndian)
  4. getLong(byte[] buf, int pos, boolean bigEndian)
  5. getLong(byte[] bytes)
  6. getLong5(byte[] b, int offset)
  7. getLongFromByteArray(final byte[] bytes)
  8. toLong(byte[] b, int pos)
  9. toLong(byte[] b, int pos, int width)