Java Int64 Convert Int642Bytes(long sour)

Here you can find the source of Int642Bytes(long sour)

Description

Int Bytes

License

Open Source License

Declaration

public static byte[] Int642Bytes(long sour) 

Method Source Code

//package com.java2s;

public class Main {

    public static byte[] Int642Bytes(long sour) {
        byte dest[] = { (byte) ((sour & 0xFF00000000000000L) >> 56), (byte) ((sour & 0x00FF000000000000L) >> 48),
                (byte) ((sour & 0x0000FF0000000000L) >> 40), (byte) ((sour & 0x000000FF00000000L) >> 32),
                (byte) ((sour & 0x00000000FF000000L) >> 24), (byte) ((sour & 0x0000000000FF0000L) >> 16),
                (byte) ((sour & 0x000000000000FF00L) >> 8), (byte) (sour & 0x00000000000000FF) };
        return dest;
    }//from   www .jav a  2  s. co  m
}

Related

  1. int64(Object value)
  2. int64_to_buf(byte buf[], int pos, long value)
  3. int64d(byte[] buf, int off)
  4. int64ToByteArray(long value, int size)
  5. int64toInt32(long key)