Java tutorial
//package com.java2s; public class Main { public static StringBuilder m820a(byte b) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < 8; i++) { stringBuilder.append((b >> (8 - (i + 1))) & 1); } stringBuilder.trimToSize(); return stringBuilder; } }