Chaining Streams For Ease of Use

   

Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Chapter 12.  Using Java's Input and Output Classes


You might have noticed that many of the I/O classes take as an argument to their constructors another stream type. The term for building streams from streams is referred to as chaining. The idea is that you will read each stream in the best manner depending on the type of data. If the data is text, the best way to read it is through a BufferedReader, but if the data is a collection of primitive types, it is best read using a DataInputStream.


       
    Top
     



    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net