Java Byte to Binary byteToBinaryString(byte toString)

Here you can find the source of byteToBinaryString(byte toString)

Description

byte To Binary String

License

Open Source License

Declaration

public static String byteToBinaryString(byte toString) 

Method Source Code

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

public class Main {
    public static String byteToBinaryString(byte toString) {
        String string = "";

        String s = String.format("%8s", Integer.toBinaryString(toString & 0xFF)).replace(' ', '0');
        string += s;/* w ww.  j  ava 2 s .  c o m*/

        return string;
    }
}

Related

  1. byteToBin(byte[] bs)
  2. byteToBinary(byte value)
  3. byteToBinaryStr(byte b)
  4. byteToBinaryString(byte i)