Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Binary

 
zniter goh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i use datainputstream to read a file and how can i look at the binary of the byte that i have read.
thx...
 
Shivaji Marathe
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the static toBinaryString method of the integer class.
You can also convert the byte on your own using the & operator ;-) and string manipulation
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic