Here you can find the source of byteToBinaryString(byte toString)
public static String byteToBinaryString(byte toString)
//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; } }