File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String or Char -> Binary Representation

 
Ilko Ivanov
Greenhorn
Posts: 9
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic