Java Byte Array Create toBytes(long value)

Here you can find the source of toBytes(long value)

Description

to Bytes

License

Apache License

Declaration

public static byte[] toBytes(long value) 

Method Source Code

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

public class Main {
    public static byte[] toBytes(long value) {
        return new byte[] { (byte) (value >>> 56), (byte) (value >>> 48),
                (byte) (value >>> 40), (byte) (value >>> 32),
                (byte) (value >>> 24), (byte) (value >>> 16),
                (byte) (value >>> 8), (byte) value };
    }/*from   w  w  w  .  j av  a 2  s .  c  o  m*/
}

Related

  1. toBytes(long number)
  2. toBytes(long size)
  3. toBytes(long v, byte[] writeBuffer, int o)
  4. toBytes(long val)
  5. toBytes(long value)
  6. toBytes(long value)
  7. toBytes(long value, int numBytes)
  8. toBytes(long... values)
  9. toBytes(Object objValue)