Here you can find the source of toBitString(int meta)
public static String toBitString(int meta)
//package com.java2s; //License from project: Open Source License public class Main { public static String toBitString(int meta) { StringBuilder sb = new StringBuilder(); for (int k = 0; k < 4; k++) { if (((meta >> k) & 1) == 1) { sb.append(1);// ww w .j av a2 s . c om } else { sb.append(0); } } return sb.toString(); } }