Java Long to Byte longToByte(long number)

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

Description

long To Byte

License

Apache License

Declaration

public static byte[] longToByte(long number) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static byte[] longToByte(long number) {
        byte[] b = new byte[8];
        for (int i = 7; i >= 0; i--) {
            b[i] = (byte) (number % 256);
            number >>= 8;/*from  w ww. j ava2s .co  m*/
        }
        return b;
    }
}

Related

  1. longToByte(long i)
  2. longToByte(long i_Value)
  3. longToByte(long l)
  4. longToByte(long l)
  5. longToByte(long l)
  6. longToByte(long value)
  7. longToByte(long x)
  8. longToByte(long[] values)
  9. longToByte8(long value)