Oopm
Oopm
Group project by
Arfaan Shah
Dev Sharma
Khushi Shetty
Shreyas Swaminath
INTRODUCTION TO JAVA I/O
What is Java I/O?
• I/O stands for Input and Output. It refers to the process of
reading (input) data from a source and writing (output) data to
a destination.
• Java provides an extensive set of tools (classes and methods)
to handle I/O operations, such as interacting with the file
system, network resources, or user input.
• Streams are used in Java to read or write data. A stream is
essentially a sequence of data elements that are processed
sequentially.
• Java has two primary types of streams:
a. Byte Streams handle binary data like images, audio, etc.
Byte Streams:
1.Byte streams are used to handle raw binary data. These
are essential when dealing with non-text data like
images, audio, or video files.
2.The two main abstract classes are:
. InputStream (for reading binary data).
. OutputStream (for writing binary data).
3. Example: FileInputStream and FileOutputStream are
specific implementations of byte streams that handle
files.
CHARACTER STREAMS:
Common Implementations:
Key Methods:
int read(): Reads the next byte of data from the input stream.
void close(): Closes the input stream and releases any system resources.
OUTPUTSTREAM:
I. O U T P U T S T R E A M I S A N A B S T R A C T C L A S S F O R
W R I T I N G R AW BY T ES .
II.C O M M O N I M P L E M E N TAT I O N S :
III.K E Y M E T H O D S :
THANK YOU