Java Byte Array to Long bytesToLong(byte a, byte b, byte c, byte d)

Here you can find the source of bytesToLong(byte a, byte b, byte c, byte d)

Description

bytes To Long

License

Apache License

Declaration

private static long bytesToLong(byte a, byte b, byte c, byte d) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static long bytesToLong(byte a, byte b, byte c, byte d) {
        return int2long((((a & 0xff) << 24) | ((b & 0xff) << 16) | ((c & 0xff) << 8) | (d & 0xff)));
    }/*from   ww w  .  j  a  v a  2s. c  om*/

    private static long int2long(int i) {
        long l = i & 0x7fffffffL;
        if (i < 0) {
            l |= 0x080000000L;
        }
        return l;
    }
}

Related

  1. bytes2Long(byte[] bytes)
  2. bytes2long(byte[] bytes, boolean bigEndian)
  3. bytes2Long(byte[] bytes, int offset)
  4. bytes2Long(final byte[] b)
  5. bytes2long(final byte[] bytes, final int start)
  6. bytesToLong(byte a, byte b, byte c, byte d, byte e, byte f, byte g, byte h, boolean swapBytes)
  7. bytesToLong(byte[] a, int ao)
  8. bytesToLong(byte[] arr, int offset)
  9. bytesToLong(byte[] array, int offset)