Java Long Number Create toLong(byte[] in)

Here you can find the source of toLong(byte[] in)

Description

to Long

License

Open Source License

Declaration

public static long toLong(byte[] in) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static long toLong(byte[] in) {
        return (((toInt(in[0], in[1], in[2], in[3]))) | ((long) (toInt(in[4], in[5], in[6], in[7])) << (long) 32));
    }/*from   w ww .j  av a2  s.  com*/

    public static int toInt(byte in0, byte in1, byte in2, byte in3) {
        return (in0 & 0xFF) | ((in1 & 0xFF) << 8) | ((in2 & 0xFF) << 16) | ((in3 & 0xFF) << 24);
    }

    public static int toInt(byte[] in) {
        return toInt(in[0], in[1], in[2], in[3]);
    }

    public static int toInt(byte[] in, int ofs) {
        return toInt(in[ofs + 0], in[ofs + 1], in[ofs + 2], in[ofs + 3]);
    }
}

Related

  1. ToLong(byte[] bytes, int offset)
  2. toLong(byte[] data)
  3. toLong(byte[] data)
  4. toLong(byte[] data)
  5. toLong(byte[] data)
  6. toLong(byte[] input)
  7. toLong(byte[] key)
  8. toLong(byte[] memory, int index)
  9. toLong(byte[] n)