Java Bits Convert to bitsString2(byte b)

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

Description

bits String

License

Open Source License

Declaration

public static String bitsString2(byte b) 

Method Source Code

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

public class Main {
    public static String bitsString2(byte b) {
        int i = 0;
        String s = "";
        while (i <= 7) {
            s += (b & (1 << i)) == 0 ? "0" : "1";
            i++;/*w  w w. ja v  a 2s .  co  m*/
        }
        return s;
    }
}

Related

  1. bitsCleanup(int base, int[] bits)
  2. BitsNeeded(int n)
  3. bitsRequired(double minValue, double maxValue)
  4. bitsRequired(int value)
  5. bitsRequiredForFraction(String floatnumber)
  6. bitsTo8Bytes(boolean[] bits)
  7. bitsToBase64(byte data)
  8. bitsToDouble(String bits, double min, double max, int splits)
  9. bitsToFloats(boolean[] b)