0% found this document useful (0 votes)
4 views4 pages

Understanding Java I/O: Text vs Binary

Java I/O refers to the process of reading data into and writing data from a program using streams, with all classes located in the java.io package. It includes Text I/O for human-readable data using Reader and Writer classes, and Binary I/O for non-text files like images and audio using InputStream and OutputStream classes. Key distinctions are that Text I/O deals with readable text files while Binary I/O handles raw byte files.

Uploaded by

lhemadevi85131
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views4 pages

Understanding Java I/O: Text vs Binary

Java I/O refers to the process of reading data into and writing data from a program using streams, with all classes located in the java.io package. It includes Text I/O for human-readable data using Reader and Writer classes, and Binary I/O for non-text files like images and audio using InputStream and OutputStream classes. Key distinctions are that Text I/O deals with readable text files while Binary I/O handles raw byte files.

Uploaded by

lhemadevi85131
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Java I/O (Input/Output)

• What is Java I/O?


• - Read data into a program and write data
from a program
• - Works using streams (like pipes that carry
data in/out)
• - All classes are in [Link] package
• Purpose: Efficient input/output operations in
Java
Text I/O
• - Works with letters, numbers, and text
(human-readable)
• - Uses Reader and Writer classes (FileReader,
BufferedReader, FileWriter, PrintWriter)
• - Examples: [Link], [Link]
• - Remember: Text = readable by humans
Binary I/O
• - Works with non-text files like images, audio,
videos, or objects
• - Uses InputStream and OutputStream classes
(FileInputStream, BufferedInputStream,
FileOutputStream, ObjectOutputStream)
• - Examples: [Link], song.mp3
• - Remember: Binary = raw bytes
Key Points to Remember
• - Streams are used for all I/O operations
• - Text I/O → readable text files
• - Binary I/O → raw files like photos, music,
objects
• - Simple way to remember: Text = readable,
Binary = bytes

You might also like