Java Byte Array to Long byteToLong(byte[] buf, int off)

Here you can find the source of byteToLong(byte[] buf, int off)

Description

byte To Long

License

Open Source License

Declaration

public static long byteToLong(byte[] buf, int off) 

Method Source Code

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

public class Main {
    public static long byteToLong(byte[] buf, int off) {
        return (((long) buf[off + 0] << 56) + ((long) (buf[off + 1] & 255) << 48)
                + ((long) (buf[off + 2] & 255) << 40) + ((long) (buf[off + 3] & 255) << 32)
                + ((long) (buf[off + 4] & 255) << 24) + ((buf[off + 5] & 255) << 16) + ((buf[off + 6] & 255) << 8)
                + ((buf[off + 7] & 255) << 0));
    }//from  ww w  .  j  a v  a2  s . co m
}

Related

  1. bytesToLong(final byte[] bytes)
  2. bytesToLong(final byte[] data, final int offset)
  3. bytesToLongLE(byte[] bytes, int off)
  4. byteToLong(byte[] b)
  5. byteToLong(byte[] b)
  6. byteToLong(byte[] byteArray)
  7. byteToLong(byte[] bytesToConvert)
  8. byteToLong(byte[] i_Value)
  9. byteToLong(byte[] values)