Java Long Number Create toLong(byte[] buf)

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

Description

to Long

License

Open Source License

Declaration

public final static long toLong(byte[] buf) 

Method Source Code

//package com.java2s;

public class Main {
    public final static long toLong(byte[] buf) {
        long result = 0;
        for (int i = 0; i < buf.length; i++) {
            long k = buf[i] & 0xff;
            long t = k << (i * 8);
            result |= t;/*from w  w  w .  java2  s .  co m*/
        }
        return result;
    }
}

Related

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