Java Byte Array to Int Bytes2Int64(byte[] sour, int offset)

Here you can find the source of Bytes2Int64(byte[] sour, int offset)

Description

Bytes Int

License

Open Source License

Declaration

public static long Bytes2Int64(byte[] sour, int offset) 

Method Source Code

//package com.java2s;

public class Main {

    public static long Bytes2Int64(byte[] sour, int offset) {
        return ((((long) sour[offset] << 56) & 0xFF00000000000000L)
                | (((long) sour[offset + 1] << 48) & 0x00FF000000000000L)
                | (((long) sour[offset + 2] << 40) & 0x0000FF0000000000L)
                | (((long) sour[offset + 3] << 32) & 0x000000FF00000000L)
                | ((sour[offset + 4] << 24) & 0x00000000FF000000L)
                | ((sour[offset + 5] << 16) & 0x0000000000FF0000L) | ((sour[offset + 6] << 8) & 0x000000000000FF00L)
                | (sour[offset + 7] & 0x00000000000000FFL));
    }//  w ww . j a v  a 2s.  c  o m
}

Related

  1. bytes2int(byte[] in, int index1, int index2, int index3)
  2. bytes2int(byte[] src)
  3. bytes2Int(byte[] src, int start)
  4. Bytes2Int16(byte[] sour, int offset)
  5. Bytes2Int32(byte[] sour, int offset)
  6. bytes2IntArray(byte[] bytes)
  7. bytes2Integer(byte[] byteVal)
  8. bytes2LengthToIntLowOrder(byte[] intBytes)
  9. bytes2ToInt(byte[] inputValues)