Here you can find the source of toBinaryString(final char[] arr)
public static String toBinaryString(final char[] arr)
//package com.java2s; public class Main { public static String toBinaryString(final byte[] arr) { final StringBuilder buffer = new StringBuilder(); buffer.append('['); if (arr.length > 0) buffer.append(Integer.toBinaryString(arr[0])); for (int i = 1; i < arr.length; i++) { buffer.append(' '); buffer.append(Integer.toBinaryString(arr[i])); }//w w w . j a va2s . c o m buffer.append(']'); return buffer.toString(); } public static String toBinaryString(final char[] arr) { final StringBuilder buffer = new StringBuilder(); buffer.append('['); if (arr.length > 0) buffer.append(Integer.toBinaryString(arr[0])); for (int i = 1; i < arr.length; i++) { buffer.append(' '); buffer.append(Integer.toBinaryString(arr[i])); } buffer.append(']'); return buffer.toString(); } public static String toBinaryString(final short[] arr) { final StringBuilder buffer = new StringBuilder(); buffer.append('['); if (arr.length > 0) buffer.append(Integer.toBinaryString(arr[0])); for (int i = 1; i < arr.length; i++) { buffer.append(' '); buffer.append(Integer.toBinaryString(arr[i])); } buffer.append(']'); return buffer.toString(); } public static String toBinaryString(final int[] arr) { final StringBuilder buffer = new StringBuilder(); buffer.append('['); if (arr.length > 0) buffer.append(Integer.toBinaryString(arr[0])); for (int i = 1; i < arr.length; i++) { buffer.append(' '); buffer.append(Integer.toBinaryString(arr[i])); } buffer.append(']'); return buffer.toString(); } public static String toBinaryString(final long[] arr) { final StringBuilder buffer = new StringBuilder(); buffer.append('['); if (arr.length > 0) buffer.append(Long.toBinaryString(arr[0])); for (int i = 1; i < arr.length; i++) { buffer.append(' '); buffer.append(Long.toBinaryString(arr[i])); } buffer.append(']'); return buffer.toString(); } }