Java Long Number Create toLong(byte[] bytes)

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

Description

to Long

License

Apache License

Declaration

public static long toLong(byte[] bytes) 

Method Source Code

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

public class Main {

    public static long toLong(byte[] bytes) {
        long num = 0;
        if (bytes != null) {
            for (int i = bytes.length - 1, j = 0; i >= 0; i--, j++) {
                num += (long) (bytes[i] & 0xff) << (j * 8);
            }/*  www.  j  ava2s .  c  om*/
        }
        return num;
    }
}

Related

  1. toLong(byte[] buf)
  2. toLong(byte[] buf)
  3. toLong(byte[] buf, int off)
  4. toLong(byte[] buf, int pos)
  5. toLong(byte[] byteArray)
  6. toLong(byte[] bytes)
  7. toLong(byte[] bytes)
  8. toLong(byte[] bytes)
  9. toLong(byte[] bytes)