Android Byte Array to Long Convert toLong(byte[] src, int srcPos)

Here you can find the source of toLong(byte[] src, int srcPos)

Description

to Long

Declaration

public static long toLong(byte[] src, int srcPos) 

Method Source Code

//package com.java2s;

public class Main {

    public static long toLong(byte[] src, int srcPos) {
        long qword = 0;
        for (int i = 0; i < 8; i++) {
            qword = (qword << 8) + (src[i + srcPos] & 0xFF);
        }//  w  ww.java  2 s. co  m
        return qword;
    }

    public static long toLong(byte[] src) {
        return toLong(src, 0);
    }
}

Related

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