Java Byte to Bit byteToBitStr(byte b)

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

Description

byte To Bit Str

License

Open Source License

Declaration

public static String byteToBitStr(byte b) 

Method Source Code

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

public class Main {
    public static String byteToBitStr(byte b) {
        String zero = "00000000";
        String s = Integer.toBinaryString(b);
        return zero.substring(0, 8 - s.length()) + s;
    }/*from ww  w .  ja va  2 s .  c o m*/
}

Related

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