Managing Input
Managing Input
Managing Input
OUTPUT FILES IN
JAVA
2
CONCEPTS OF STREAMS
I/O libraries often use the abstraction of a stream, which represents any
data source or sink as an object capable of producing or receiving pieces of
data.
The Java library classes for I/O are divided by input and output. You need to
import java.io package to use streams. There is no need to learn all the
streams just do it on the need basis.
• It is an abstraction of a data source/sink
5
6
IMPORTANT CLASSES OF BYTE STREAMS ARE: java.io.InputStream and
java.io.OutputStream. these are
abstract base classes for many subclasses.
1. InputStream
• ByteArrayInputStream
• FileInputStream
• PipedInputStream
• ObjectInputStream
• FilterInputStream
7
2. OutputStream
• ByteArrayOutputStream
• FileOutputStream
• PipedOutputStream
• ObjectOutputStream
• FilterOutputStream
8
9
FILE CLASS
11
THANK YOU