Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String or Char -> Binary Representation

 
Ilko Ivanov
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic