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

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

Description

to Long

Declaration

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

Method Source Code

//package com.java2s;

public class Main {

    public static long toLong(byte[] b, int pos) {
        return toLong(b, pos, 8);
    }/* www .  j  av a 2 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[] bytes)
  2. getLong4(byte[] b, int offset)
  3. getLong5(byte[] b, int offset)
  4. getLongFromByteArray(final byte[] bytes)
  5. toLong(byte[] b, int pos)
  6. toLong(byte[] src)
  7. toLong(byte[] src, int srcPos)
  8. makeLong(byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1, byte b0)
  9. getLong(byte[] src, boolean bigEndin)