Java Byte to Bit byteToBits(byte b)

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

Description

byte To Bits

License

Open Source License

Declaration

public static boolean[] byteToBits(byte b) 

Method Source Code

//package com.java2s;
//    it under the terms of the GNU Lesser General Public License as published by

public class Main {
    public static boolean[] byteToBits(byte b) {
        boolean[] bits = new boolean[8];
        for (int i = 0; i < 8; i++) {
            bits[7 - i] = ((b & (1 << i)) != 0);
        }/*from w w w  .j ava  2 s  .  c  o  m*/
        return bits;
    }
}

Related

  1. byteToBit(byte b)
  2. byteToBitArray(byte b)
  3. byteToBits(byte b)
  4. byteToBits(byte b)
  5. byteToBits(byte b)
  6. byteToBits(byte b)
  7. byteToBitsArray(byte b)