Java Number Unpack unpackDigital(int packed)

Here you can find the source of unpackDigital(int packed)

Description

unpack Digital

License

Open Source License

Declaration

public static byte[] unpackDigital(int packed) 

Method Source Code

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

public class Main {
    public static byte[] unpackDigital(int packed) {

        if (packed == 0)
            return new byte[16];
        byte[] sig = new byte[16];
        for (int i = 0; i < 16; i++)
            sig[i] = (byte) (((packed & 1 << i) == 0) ? 0 : 255);
        return sig;
    }/* w ww. j a v a2s . co m*/
}

Related

  1. unpack64(long num)
  2. unpackInt(final int argb, final int type)
  3. unpackInt(int packedInt, int numBits, int numShiftedLeft)
  4. unpackInt(long theLong, boolean isFirst)
  5. unpackInts(long... longs)