Java Long Number From longFromByteArray(final byte[] buf, final int offset)

Here you can find the source of longFromByteArray(final byte[] buf, final int offset)

Description

long From Byte Array

License

Apache License

Declaration

public static final long longFromByteArray(final byte[] buf, final int offset) 

Method Source Code

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

public class Main {
    public static final long longFromByteArray(final byte[] buf, final int offset) {
        long v = 0;
        v |= ((((long) buf[offset + 0]) & 0xFF) << 56);
        v |= ((((long) buf[offset + 1]) & 0xFF) << 48);
        v |= ((((long) buf[offset + 2]) & 0xFF) << 40);
        v |= ((((long) buf[offset + 3]) & 0xFF) << 32);
        v |= ((((long) buf[offset + 4]) & 0xFF) << 24);
        v |= ((((long) buf[offset + 5]) & 0xFF) << 16);
        v |= ((((long) buf[offset + 6]) & 0xFF) << 8);
        v |= ((((long) buf[offset + 7]) & 0xFF) << 0);
        return v;
    }//  ww  w  .j  av a 2 s . c o m
}

Related

  1. longFromBase64(String value)
  2. longFromBigEndainArray(byte[] buf, int offset, int len)
  3. longFromByteArray(byte[] bytes)
  4. longFromBytes(byte b8, byte b7, byte b6, byte b5, byte b4, byte b3, byte b2, byte b1)
  5. longFrombytes(byte[] b, int pos)
  6. longFromBytes(byte[] buffer, int offset)
  7. longFromBytes(byte[] bytes, int index)