SlideShare una empresa de Scribd logo
1 de 19
FILE HANDLING
CONTENTS
Introduction
 Concept Of Streams
 Stream Classes
 Types Of Stream Classes
 Reading and Writing Characters
 Reading and Writing Bytes
 Handling Primitive Data Types
 Concatenating & Buffering Files
 Random Access Files
 Interactive I/O

INTRODUCTION


File is a collection of bytes stored in secondary storage
device i.e. disk.



File handling is used to read, write, append or update a
file without directly opening it.



Storing and managing data using files is known as File
Processing.
CONCEPT OF STREAMS
STREAM CLASSES
 java.io

package contain large no of stream
classes.

 It

provide capability to process all type of data
CLASSIFICATION OF STREAM CLASSES
1.BYTE STREAM CLASSES


It provide features for creating and manipulating streams
and files for reading and writing bytes.



It has 2 classes:
InputStream Classes
 OutputStream Classes

A.INPUTSTREAM

CLASSES
METHODS OF INPUTSTREAM


public void read()




public void read(byte b[])




Reads a single byte from input stream.

Reads an array of bytes.

public void close


Close input stream.
B.OUTPUTSTREAM CLASSES
METHODS OF OUTPUTSTREAM


public void write()




public void write(byte b[])




Write all bytes in an array.

public void flush()




Write single byte to an output stream.

Flushes the output stream.

public void write(byte b[], int n, int m)


Write m bytes from array b starting from nth byte.
2.CHARACTER STREAM CLASSES


It can be used to read and write character.



It has 2 classes:
Reader Streams Classes
 Writer Streams Classes

READING /WRITING CHARACTERS


It provide a way to:
Read characters from a file.
 Write characters to any file.




Methods used:
FileReader
 FileWriter


Program cpy1.java
READING /WRITING BYTES


It allow us to
Read bytes from files
 Write bytes to file.




Methods used:
FileInputStream
 FileOutputStream


Program cpy1_byte.java
Program cpy2_byte.java
Program read_byte.java
HANDLING PRIMITIVE TYPES


Its used to add primitive data into file



Following methods used:
writeInt
 writeDouble
 WriteBoolean


Program cpy3_prim.java
CONCATENATION & BUFFERING FILES
Concatenation
 To combine 2 or more input files into 1 input file.
 It’s achieved using:


SequenceInputStream

Buffering
 To store temporarily data i.e read/write to a file.
 It’s created using:


BufferedInputStream

program sb.java
RANDOM ACCESS FILES


It allow us to create a file that can be used for reading &
writing data with random access.



It has 2 mode strings
“r” for reading only
 “rw” for both reading & writing


Program randomIO.java
Program rand.java
INTERACTIVE I/O


It’s process of reading data from keyboard & displaying
output on screen.



Two types of interactive i/o:
Simple interactive i/o
 Graphical interactive i/o


Program aj.java
THANK
YOU

Más contenido relacionado

La actualidad más candente

java.io - streams and files
java.io - streams and filesjava.io - streams and files
java.io - streams and filesMarcello Thiry
 
9. Input Output in java
9. Input Output in java9. Input Output in java
9. Input Output in javaNilesh Dalvi
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and OperatorsMarwa Ali Eissa
 
LinkedList vs ArrayList in Java | Edureka
LinkedList vs ArrayList in Java | EdurekaLinkedList vs ArrayList in Java | Edureka
LinkedList vs ArrayList in Java | EdurekaEdureka!
 
input/ output in java
input/ output  in javainput/ output  in java
input/ output in javasharma230399
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVASURIT DATTA
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in javaTech_MX
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methodsShubham Dwivedi
 
Java Input Output (java.io.*)
Java Input Output (java.io.*)Java Input Output (java.io.*)
Java Input Output (java.io.*)Om Ganesh
 
Java Data Types
Java Data TypesJava Data Types
Java Data TypesSpotle.ai
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVAAnkita Totala
 

La actualidad más candente (20)

java.io - streams and files
java.io - streams and filesjava.io - streams and files
java.io - streams and files
 
Java input
Java inputJava input
Java input
 
JDK,JRE,JVM
JDK,JRE,JVMJDK,JRE,JVM
JDK,JRE,JVM
 
Java I/O
Java I/OJava I/O
Java I/O
 
9. Input Output in java
9. Input Output in java9. Input Output in java
9. Input Output in java
 
Data Types, Variables, and Operators
Data Types, Variables, and OperatorsData Types, Variables, and Operators
Data Types, Variables, and Operators
 
LinkedList vs ArrayList in Java | Edureka
LinkedList vs ArrayList in Java | EdurekaLinkedList vs ArrayList in Java | Edureka
LinkedList vs ArrayList in Java | Edureka
 
Packages in java
Packages in javaPackages in java
Packages in java
 
input/ output in java
input/ output  in javainput/ output  in java
input/ output in java
 
Wrapper class
Wrapper classWrapper class
Wrapper class
 
Exception Handling in JAVA
Exception Handling in JAVAException Handling in JAVA
Exception Handling in JAVA
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Inheritance in java
Inheritance in javaInheritance in java
Inheritance in java
 
wrapper classes
wrapper classeswrapper classes
wrapper classes
 
Java abstract class & abstract methods
Java abstract class & abstract methodsJava abstract class & abstract methods
Java abstract class & abstract methods
 
Generics
GenericsGenerics
Generics
 
Java Input Output (java.io.*)
Java Input Output (java.io.*)Java Input Output (java.io.*)
Java Input Output (java.io.*)
 
Java Data Types
Java Data TypesJava Data Types
Java Data Types
 
Data Types & Variables in JAVA
Data Types & Variables in JAVAData Types & Variables in JAVA
Data Types & Variables in JAVA
 

Similar a File handling

File Handling in Java Oop presentation
File Handling in Java Oop presentationFile Handling in Java Oop presentation
File Handling in Java Oop presentationAzeemaj101
 
Switching & Multiplexing
Switching & MultiplexingSwitching & Multiplexing
Switching & MultiplexingMelkamuEndale1
 
Java programming Chapter 4.pptx
Java programming Chapter 4.pptxJava programming Chapter 4.pptx
Java programming Chapter 4.pptxssusera0d3d2
 
Itp 120 Chapt 19 2009 Binary Input & Output
Itp 120 Chapt 19 2009 Binary Input & OutputItp 120 Chapt 19 2009 Binary Input & Output
Itp 120 Chapt 19 2009 Binary Input & Outputphanleson
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output ConceptsVicter Paul
 
DFH PDF-converted.pptx
DFH PDF-converted.pptxDFH PDF-converted.pptx
DFH PDF-converted.pptxAmitKaur17
 
Basic i/o & file handling in java
Basic i/o & file handling in javaBasic i/o & file handling in java
Basic i/o & file handling in javaJayasankarPR2
 
Unit No 5 Files and Database Connectivity.pptx
Unit No 5 Files and Database Connectivity.pptxUnit No 5 Files and Database Connectivity.pptx
Unit No 5 Files and Database Connectivity.pptxDrYogeshDeshmukh1
 
CSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdfCSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdfVithalReddy3
 
Is2215 lecture6 lecturer_file_access
Is2215 lecture6 lecturer_file_accessIs2215 lecture6 lecturer_file_access
Is2215 lecture6 lecturer_file_accessdannygriff1
 
File Management and manipulation in C++ Programming
File Management and manipulation in C++ ProgrammingFile Management and manipulation in C++ Programming
File Management and manipulation in C++ ProgrammingChereLemma2
 
chapter-12-data-file-handling.pdf
chapter-12-data-file-handling.pdfchapter-12-data-file-handling.pdf
chapter-12-data-file-handling.pdfstudy material
 

Similar a File handling (20)

File Handling in Java Oop presentation
File Handling in Java Oop presentationFile Handling in Java Oop presentation
File Handling in Java Oop presentation
 
Switching & Multiplexing
Switching & MultiplexingSwitching & Multiplexing
Switching & Multiplexing
 
Java programming Chapter 4.pptx
Java programming Chapter 4.pptxJava programming Chapter 4.pptx
Java programming Chapter 4.pptx
 
Itp 120 Chapt 19 2009 Binary Input & Output
Itp 120 Chapt 19 2009 Binary Input & OutputItp 120 Chapt 19 2009 Binary Input & Output
Itp 120 Chapt 19 2009 Binary Input & Output
 
Data file handling
Data file handlingData file handling
Data file handling
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output Concepts
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
 
DFH PDF-converted.pptx
DFH PDF-converted.pptxDFH PDF-converted.pptx
DFH PDF-converted.pptx
 
Basic i/o & file handling in java
Basic i/o & file handling in javaBasic i/o & file handling in java
Basic i/o & file handling in java
 
File Handling
File HandlingFile Handling
File Handling
 
Jstreams
JstreamsJstreams
Jstreams
 
Lecture 23
Lecture 23Lecture 23
Lecture 23
 
Unit No 5 Files and Database Connectivity.pptx
Unit No 5 Files and Database Connectivity.pptxUnit No 5 Files and Database Connectivity.pptx
Unit No 5 Files and Database Connectivity.pptx
 
CSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdfCSE3146-ADV JAVA M2.pdf
CSE3146-ADV JAVA M2.pdf
 
IOStream.pptx
IOStream.pptxIOStream.pptx
IOStream.pptx
 
Is2215 lecture6 lecturer_file_access
Is2215 lecture6 lecturer_file_accessIs2215 lecture6 lecturer_file_access
Is2215 lecture6 lecturer_file_access
 
Io Streams
Io StreamsIo Streams
Io Streams
 
File Management and manipulation in C++ Programming
File Management and manipulation in C++ ProgrammingFile Management and manipulation in C++ Programming
File Management and manipulation in C++ Programming
 
Filepointers1 1215104829397318-9
Filepointers1 1215104829397318-9Filepointers1 1215104829397318-9
Filepointers1 1215104829397318-9
 
chapter-12-data-file-handling.pdf
chapter-12-data-file-handling.pdfchapter-12-data-file-handling.pdf
chapter-12-data-file-handling.pdf
 

Más de priya_trehan

Más de priya_trehan (14)

Security Mechanisms
Security MechanismsSecurity Mechanisms
Security Mechanisms
 
Wordpress
WordpressWordpress
Wordpress
 
Types of E commerce & Payment Models
Types of E commerce & Payment ModelsTypes of E commerce & Payment Models
Types of E commerce & Payment Models
 
Friction as a necessary evil
Friction as a necessary evilFriction as a necessary evil
Friction as a necessary evil
 
Introduction to trees
 Introduction to trees Introduction to trees
Introduction to trees
 
Datapreprocessing
DatapreprocessingDatapreprocessing
Datapreprocessing
 
Johari window
Johari windowJohari window
Johari window
 
Input output
Input outputInput output
Input output
 
Silent sound technology
Silent sound technologySilent sound technology
Silent sound technology
 
Packages
PackagesPackages
Packages
 
Protocols
ProtocolsProtocols
Protocols
 
Kiosk
KioskKiosk
Kiosk
 
Photoshop
PhotoshopPhotoshop
Photoshop
 
Art of listening
Art of listeningArt of listening
Art of listening
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

File handling

  • 2. CONTENTS Introduction  Concept Of Streams  Stream Classes  Types Of Stream Classes  Reading and Writing Characters  Reading and Writing Bytes  Handling Primitive Data Types  Concatenating & Buffering Files  Random Access Files  Interactive I/O 
  • 3. INTRODUCTION  File is a collection of bytes stored in secondary storage device i.e. disk.  File handling is used to read, write, append or update a file without directly opening it.  Storing and managing data using files is known as File Processing.
  • 5. STREAM CLASSES  java.io package contain large no of stream classes.  It provide capability to process all type of data
  • 7. 1.BYTE STREAM CLASSES  It provide features for creating and manipulating streams and files for reading and writing bytes.  It has 2 classes: InputStream Classes  OutputStream Classes 
  • 9. METHODS OF INPUTSTREAM  public void read()   public void read(byte b[])   Reads a single byte from input stream. Reads an array of bytes. public void close  Close input stream.
  • 11. METHODS OF OUTPUTSTREAM  public void write()   public void write(byte b[])   Write all bytes in an array. public void flush()   Write single byte to an output stream. Flushes the output stream. public void write(byte b[], int n, int m)  Write m bytes from array b starting from nth byte.
  • 12. 2.CHARACTER STREAM CLASSES  It can be used to read and write character.  It has 2 classes: Reader Streams Classes  Writer Streams Classes 
  • 13. READING /WRITING CHARACTERS  It provide a way to: Read characters from a file.  Write characters to any file.   Methods used: FileReader  FileWriter  Program cpy1.java
  • 14. READING /WRITING BYTES  It allow us to Read bytes from files  Write bytes to file.   Methods used: FileInputStream  FileOutputStream  Program cpy1_byte.java Program cpy2_byte.java Program read_byte.java
  • 15. HANDLING PRIMITIVE TYPES  Its used to add primitive data into file  Following methods used: writeInt  writeDouble  WriteBoolean  Program cpy3_prim.java
  • 16. CONCATENATION & BUFFERING FILES Concatenation  To combine 2 or more input files into 1 input file.  It’s achieved using:  SequenceInputStream Buffering  To store temporarily data i.e read/write to a file.  It’s created using:  BufferedInputStream program sb.java
  • 17. RANDOM ACCESS FILES  It allow us to create a file that can be used for reading & writing data with random access.  It has 2 mode strings “r” for reading only  “rw” for both reading & writing  Program randomIO.java Program rand.java
  • 18. INTERACTIVE I/O  It’s process of reading data from keyboard & displaying output on screen.  Two types of interactive i/o: Simple interactive i/o  Graphical interactive i/o  Program aj.java