Java Streams   «Prev  Next»
Lesson 10

Writing Data Output Streams - Conclusion

This module discussed how to write data by using Java output streams. You learned how to copy a file to System.out with maximum efficiency, when to flush and close an output stream, and how to use file streams.
In the next module you will learn about filter streams. Filter streams have two purposes.
First, they allow you to read and write data at a higher level than working with the raw bytes. For example, you will learn to read a file that is full of double values and write another file of double values.
Second, you will learn how to use a filter stream to modify data as it is read.

public class DataOutputStream
extends FilterOutputStream
implements DataOutput

A data output stream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in.

Constructor Detail

public DataOutputStream(OutputStream out)

Creates a new data output stream to write data to the specified underlying output stream. The counter written is set to zero. Parameters: out - the underlying output stream, to be saved for later use.