wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes String or Char -> Binary Representation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "String or Char -> Binary Representation" Watch "String or Char -> Binary Representation" New topic

String or Char -> Binary Representation

Ilko Ivanov

Joined: Aug 04, 2011
Posts: 9
Hi guys,
I don't really know how it works but I wanna convert a String to its binary representation.
It can be done char by char or the whole String at once.

Thank you!

Todd Buell

Joined: May 31, 2005
Posts: 21
I believe you're looking for the String.getBytes methods. Be sure to read up on which you need, depending on the encoding of the String.

Also useful would be Integer.toBinaryString.
Consider Paul's rocket mass heater.
subject: String or Char -> Binary Representation