Java Long to Byte longToByte(long a_value)

Here you can find the source of longToByte(long a_value)

Description

long To Byte

License

Open Source License

Parameter

Parameter Description
a_value a parameter

Declaration

private static byte[] longToByte(long a_value) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w  ww  . ja v  a 2  s  .com*/
     * 
     * @param a_value
     * @return
     */
    private static byte[] longToByte(long a_value) {
        byte[] bytes = new byte[8];
        for (int i = 1; i <= bytes.length; i++) {
            bytes[8 - i] = new Long(a_value).byteValue();
            a_value = a_value >> 8;
        }
        return bytes;
    }
}

Related

  1. long2byte(long ival, byte b[], int offset)
  2. long2byte(long l)
  3. long2byte(long l)
  4. longToByte(byte[] buf, int off, long value)
  5. longToByte(final long value)
  6. longToByte(long i)
  7. longToByte(long i_Value)
  8. longToByte(long l)
  9. longToByte(long l)