Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

when to use characters or bytes  RSS feed

 
david allen
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please help me understand this. I have read about this very much but I just need a practical understanding of it.
From my understanding the java io can be broken into two main types:
1. classes that operate in bytes.
2. classes that operate in characters.
I can never decdide when to use one or the other. Can someone please provide me with a rule of thumb.
Thank you
david
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Short answer: if you're dealing with text, use Writers and Reader (use chars). If you're dealing with binary data (image data, etc.) use Streams (bytes.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!