Here you can find the source of longToByte(long a_value)
Parameter | Description |
---|---|
a_value | a parameter |
private static byte[] longToByte(long a_value)
//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; } }