Java Byte Array to Long bytesToLong(byte[] inbytes, int shift)

Here you can find the source of bytesToLong(byte[] inbytes, int shift)

Description

bytes To Long

License

Open Source License

Declaration

public static long bytesToLong(byte[] inbytes, int shift) 

Method Source Code

//package com.java2s;

public class Main {
    public static long bytesToLong(byte[] inbytes, int shift) {
        long result = 0;
        for (int i = 0 + shift; i < 8 + shift; i++) {
            result = (result << 8) + (inbytes[i] & 0xff); // [unsigned byte]
        }//from w  w w .j  a va 2s .co m

        return result;
    }
}

Related

  1. bytesToLong(byte[] bytes, int off, boolean bigEndian)
  2. bytesToLong(byte[] data)
  3. bytesToLong(byte[] data)
  4. bytesToLong(byte[] data)
  5. bytesToLong(byte[] data, int offset)
  6. bytesToLong(byte[] longBytes)
  7. bytesToLong(byte[] p, int offset)
  8. bytesToLong(final byte[] b)
  9. bytesToLong(final byte[] bytes)