Android Byte Array to Long Convert toLong(byte[] b, int pos)

Here you can find the source of toLong(byte[] b, int pos)

Description

to Long

Declaration

public static long toLong(byte[] b, int pos) 

Method Source Code

//package com.java2s;

public class Main {

    public static long toLong(byte[] b, int pos) {
        return toLong(b, pos, 8);
    }//w  ww .ja v a2  s  .  c  o  m

    public static long toLong(byte[] b, int pos, int width) {
        long ret = 0;
        for (int i = 0; i < width; i++) {
            ret |= (b[i + pos] & 0xFFl) << (8 * i);
        }
        return ret;
    }
}

Related

  1. getLong(byte[] buf, int pos, boolean bigEndian)
  2. getLong(byte[] bytes)
  3. getLong4(byte[] b, int offset)
  4. getLong5(byte[] b, int offset)
  5. getLongFromByteArray(final byte[] bytes)
  6. toLong(byte[] b, int pos, int width)
  7. toLong(byte[] src)
  8. toLong(byte[] src, int srcPos)
  9. makeLong(byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1, byte b0)