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

Byte and character oriented

 
Nitin Kharbade
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When to use Byte and character oriented classes in file operation especially? Generally which one is used. Thanks.
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitin Kharbade wrote:When to use Byte and character oriented classes in file operation especially? Generally which one is used. Thanks.


When your data is binary use bytes and when it is text use characters. It is normally safe to use byte for holding text but it is most definitely not safe to use characters for holding binary data.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic