Java Long to Byte Array longToBytes(long n, byte b[], int offset)

Here you can find the source of longToBytes(long n, byte b[], int offset)

Description

long To Bytes

License

Open Source License

Declaration

public static void longToBytes(long n, byte b[], int offset) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static void longToBytes(long n, byte b[], int offset) {
        for (int i = 0; i < 8; i++) {
            b[offset + i] = (byte) (n & 0xff);
            n = n >> 8;// www. j  av  a 2  s. c  o  m
        }
    }
}

Related

  1. longToBytes(long l, byte[] result)
  2. longToBytes(long ldata, int n)
  3. longToBytes(long lnum, byte[] bytes, int startIndex)
  4. longToBytes(long n)
  5. longToBytes(long n)
  6. longToBytes(long num)
  7. longToBytes(long num, byte[] data, int index)
  8. longToBytes(long number)
  9. longToBytes(long v)