Java Long Number Create toLong(byte[] bytes)

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

Description

to Long

License

Open Source License

Declaration

public static long toLong(byte[] bytes) 

Method Source Code

//package com.java2s;
// The MIT License (MIT)

public class Main {
    public static long toLong(byte[] bytes) {
        // @formatter:off
        return (bytes[0] & 0xffL) << 56 | (bytes[1] & 0xffL) << 48 | (bytes[2] & 0xffL) << 40
                | (bytes[3] & 0xffL) << 32 | (bytes[4] & 0xffL) << 24 | (bytes[5] & 0xffL) << 16
                | (bytes[6] & 0xffL) << 8 | (bytes[7] & 0xffL);
        // @formatter:on
    }/*from  w  w w.java  2  s  .  c o  m*/
}

Related

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