Skip to content

Instantly share code, notes, and snippets.

@volgar1x
Created August 5, 2012 19:10
Show Gist options
  • Save volgar1x/3266725 to your computer and use it in GitHub Desktop.
Save volgar1x/3266725 to your computer and use it in GitHub Desktop.
public static void println(String string, int radix) {
byte[] bytes = string.getBytes();
for (byte b : bytes) {
System.out.print(Integer.toString(b, radix));
}
System.out.println();
}
public static void printlnBinary(String string) {
println(string, 2);
}
// usage:
String message = "Hello World!";
printlnBinary(message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment