Java Byte to Bit byteToBitArray(byte b)

Here you can find the source of byteToBitArray(byte b)

Description

byte To Bit Array

License

Apache License

Declaration

public static boolean[] byteToBitArray(byte b) 

Method Source Code

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

public class Main {

    public static boolean[] byteToBitArray(byte b) {
        boolean[] buff = new boolean[8];
        int index = 0;
        for (int i = 7; i >= 0; i--) {
            buff[index++] = ((b >>> i) & 1) == 1;
        }//from   ww w  .j av a  2 s. co m
        return buff;
    }
}

Related

  1. byteToBit(byte b)
  2. byteToBits(byte b)
  3. byteToBits(byte b)
  4. byteToBits(byte b)
  5. byteToBits(byte b)