Redo Poges Previous Net Erase
Eraser Beckgrounds Undo
Color Line
I/Oin java ate
" Java l/O(Input and Output) is used to process the input and produce O
the output based onthe [Link] uses the concept ofStreamto make
WO operation fast.
The [Link] packag contains all the classes required for input and
output operations. L
Stream: Astreamcan be defined as a sequence of data. there are two
kinds of Streams
" InputStream:The InputStream is used to read data from a source.
OutputStream:the OutputStream is used for writing data to a destination
3
AL
Byte Streams :- Java byte streams are used to perform input
and output of 8-bit bytesFilelnputStream , FileOutputStream.
" Character Streams :- Java Character streams are used to
perform input and output for 16-bit [Link],
FileWriter
Unde Kedo Peges Previous Nexd Erase
Color Lin Eraser Badgrounds
Standard Streams
Standard Input:This is used to feed the data to user's program
and usually a keyboard is used as standard input stream and
represented as [Link].
Standard Output:This is used to output the data produced by
the user's program and usually a computer screen is used to
standard output stream and represented as [Link].
Standard Error:This is used to output the error data produced
by theuser's program and usually a computer screen is used
to standard error stream and represented as [Link].
5
/AI
Byte Stream Classes
Byte Stream classes have been designed to provide functional features for
creating and manipulating streams and files for reading and writing
bytes. Since the streams are unidirectional, they can transmit bytes in only one
direction and therefore, Java provides two kinds of byte stream classes:
InputStream class and OutputStream class.
" Input Stream Classes :- Input stream classes that are used to read 8-bit bytes
include a super class known as Input Stream and number of subclasses for
supporting various input-related functions.
Output Stream Class :- The super class InputStream is an abstract class, so we
cannot create object for the class. InputStream class defines the methods to
perform the followingfunctions
6
Character Stream
" In Java, characters are stored using Unicode conventions
(Referthisfor details). Character stream automaticalyallows us
toread/write data character bycharacter. For example
FileReader and FileWriter are character streams used to read
from source and write to destination.
Stream -Asequence of data.
Input Stream:reads data from source.
Output Stream :writes data to destination.