Java tutorial
//package com.java2s; public class Main { private static String byte2bitsReverse(byte ch) { //Log.e(TAG, "byte2bitsReverse() ch = " + ch); int z = ch; z |= 256; String str = Integer.toBinaryString(z); int len = str.length(); String result = str.substring(len - 8, len); StringBuffer sb = new StringBuffer(result); //Log.e(TAG, "byte2bitsReverse() return = " + sb.reverse().toString()); return sb.reverse().toString(); } }