标签:style blog io color sp java for on div
public static byte[] LongToBytes(long lo) { byte[] by = new byte[8]; for (int i = 0; i < 8; i++) { int offset = 64 - (i + 1) * 8; by[i] = (byte) ((lo >> offset) & 0xff); } return by; } public static long BytesToLong(byte[] by) { long io = 0; for (int i = 0; i < 8; i++) { lo <<= 8; lo|= (by[i] & 0xff); } return io; }
Java 中的 long 转 byte 及 byte 转long
标签:style blog io color sp java for on div
原文地址:http://www.cnblogs.com/xslt-cn/p/4137177.html