Java Long Number Create toLong(byte[] bytes, int index)

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

Description

to Long

License

Apache License

Declaration

public static long toLong(byte[] bytes, int index) 

Method Source Code

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

public class Main {
    public static long toLong(byte[] bytes, int index) {
        return (0xffL & (long) bytes[index]) | (0xff00L & ((long) bytes[index + 1] << 8))
                | (0xff0000L & ((long) bytes[index + 2] << 16)) | (0xff000000L & ((long) bytes[index + 3] << 24))
                | (0xff00000000L & ((long) bytes[index + 4] << 32))
                | (0xff0000000000L & ((long) bytes[index + 5] << 40))
                | (0xff000000000000L & ((long) bytes[index + 6] << 48))
                | (0xff00000000000000L & ((long) bytes[index + 7] << 56));
    }//from w  ww.j av a2s  .  co  m
}

Related

  1. toLong(byte[] bytes)
  2. toLong(byte[] bytes)
  3. toLong(byte[] bytes)
  4. toLong(byte[] bytes, boolean bigEndian)
  5. toLong(byte[] bytes, int index)
  6. toLong(byte[] bytes, int offset)
  7. ToLong(byte[] bytes, int offset)
  8. toLong(byte[] bytes, int offset)
  9. toLong(byte[] bytes, int offset)