Java Long to Byte Array long2bytes(long value, byte[] bytes, int offset)

Here you can find the source of long2bytes(long value, byte[] bytes, int offset)

Description

longbytes

License

Apache License

Declaration

public static void long2bytes(long value, byte[] bytes, int offset) 

Method Source Code

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

public class Main {
    public static void long2bytes(long value, byte[] bytes, int offset) {
        for (int i = 7; i > -1; i--) {
            bytes[offset++] = (byte) ((value >> 8 * i) & 0xFF);
        }/*from w w  w . j  a v  a  2s.  c  o  m*/
    }
}

Related

  1. long2Bytes(long num)
  2. long2bytes(long v)
  3. long2bytes(long v, int len)
  4. long2bytes(long value)
  5. long2bytes(long value, byte[] bytes, int off)
  6. long2bytes(long x)
  7. long2bytes(long... numbers)
  8. long2bytesBE(long val, byte[] b, int off)
  9. longToByteArr(long v)