The list of methods to do Bit Print are organized into topic(s).
String
printBitBinary(byte[] bytes) Transform bite array to bit representation
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
String s = Integer.toBinaryString((b & 0xFF) + 0x100).substring(1);
if (sb.length() > 0) {
sb.append(" ");
if (s.length() > 4) {
sb.append(s.substring(0, 4)).append(" ").append(s.substring(4, s.length()));
...
void
printBitboard(long bitboard) Prints a bitboard by sending the result of
bitboardToString to
System.out.
System.out.println(bitboardToString(bitboard));
void
printBitFormat(int number) print Bit Format
for (int idx = INT_SIZE - 1; idx >= 0; --idx) {
if ((number & (1 << idx)) == 0) {
System.out.print("0");
} else {
System.out.print("1");
System.out.println();
...
void
printBits(byte[] bytes) print Bits
boolean firstFlag = true;
StringBuffer logBuffer = new StringBuffer();
String b = "";
for (byte i : bytes) {
b = Integer.toHexString(i & 0xff);
b = (b.length() == 1 ? ("0" + b) : b);
if (firstFlag) {
logBuffer.append("[" + b);
...
void
printBits(int meta) print Bits
for (int k = 0; k < 4; k++) {
if (((meta >> k) & 1) == 1) {
System.out.print(1);
} else {
System.out.print(0);
System.out.println();
...
String
printBits(long value) Print the bits in the value with the leftmost bit being the most significant bit.
StringBuffer sb = new StringBuffer();
for (int shift = 63; shift >= 0; shift--)
sb.append((((value >>> shift) & 01) != 0) ? "1" : "0");
return sb.toString();