Here you can find the source of byteToBinary(byte value)
Parameter | Description |
---|---|
value | byte to convert |
public static String byteToBinary(byte value)
//package com.java2s; //License from project: Apache License public class Main { /**//w w w. j a va 2 s . c o m * Return a binary string representation of the byte. * @param value byte to convert * @return A binary string representation of the byte. */ public static String byteToBinary(byte value) { return String.format("%8s", Integer.toBinaryString(value & 0xFF)).replace(' ', '0'); } }