Sunday, June 15, 2014

Difference between byte stream and Character streams?

dealing with File Operations. 
used 
To generate User reports, send attachments through mails and spill out data files from Java programs. And a sound knowledge on File Operation becomes even more important while dealing with Java questions.


byte stream : For reading and writing binary data, byte stream is incorporated. Programs use byte streams to perform byte input and output.
  • Performing InputStream operations or OutputStream operations means generally having a loop that reads the input stream and writes the output stream one byte at a time.
  • You can use buffered I/O streams for an overhead reduction (overhead generated by each such request often triggers disk access, network activity, or some other operation that is relatively expensive).
Character streams: Character streams work with the characters rather than the byte. In Java, characters are stored by following the Unicode (allows a unique number for every character) conventions. In such kind of storage, characters become the platform independent, program independent, language independent.

No comments:

Post a Comment