When do you use the Reader/Writer classes, instead of the InputStream/OutputStream classes?

John Zukowski

The InputStream/OutputStream classes are for reading and writing bytes, while the Reader/Writer classes are for reading characters / text. If you need to process text, you use Reader/Writer. If you need to process content at the byte level, either as the raw bytes, or as higher level data like primitives (through DataInput/Output), objects (through ObjectInput/Output), or possibly compressed data (GZIPInput/Output), then you would work with an InputStrem/OutputStream.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact