Java Byte Array Create toByteArray(Long mac)

Here you can find the source of toByteArray(Long mac)

Description

to Byte Array

License

Open Source License

Declaration

public static byte[] toByteArray(Long mac) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static byte[] toByteArray(Long mac) {
        byte macArr[] = new byte[] { (byte) ((mac >> 40) & 0xff), (byte) ((mac >> 32) & 0xff),
                (byte) ((mac >> 24) & 0xff), (byte) ((mac >> 16) & 0xff), (byte) ((mac >> 8) & 0xff),
                (byte) ((mac >> 0) & 0xff), };
        return macArr;
    }/*from ww  w . j  a  v a  2  s.c om*/
}

Related

  1. toByteArray(int value, int numBytes, byte[] dest, int off)
  2. toByteArray(int[] array)
  3. toByteArray(int[] data)
  4. toByteArray(int[] data, boolean includeLength)
  5. toByteArray(long hi, long lo)
  6. toByteArray(long value)
  7. toByteArray(long value)
  8. toByteArray(Number[] array)
  9. toByteArray(Object obj)