Java File Operations

Cahit Barkin Ozer
3 min readNov 15, 2021

File operations in Java.

A File is an abstract data type in Java. Creating, writing, reading, deleting, and retrieving information are all File Operations. [1]

Hierarchy of I/O Classes in Java[2]

For Access: https://cbarkinozer.medium.com/java-file-operations-df292593a756?source=friends_link&sk=8a9fd25e81b083df5ad84a115b6ec029

To understand file operations we need to understand streams. [1]

Stream

A stream refers to a series of data. In Java, Streams in Java are divided into two types: Byte Stream and Character Stream.[1]

Byte Stream deals mostly with byte data. A file handling process with a byte stream is one in which the byte data is used to execute an input. Java byte streams are utilized to perform 8-bit byte input and output. For secure processes, this is the best option.[1][2]

Character Stream’s major focus is character data. A file handling procedure with a character stream is one in which an input is given and the character data is executed. Java Character streams are used to perform input and output for 16-bit Unicode [1][2]

Java File Class Methods: [1]

Boolean canRead(): Can we read the file’s data?

Boolean createNewFile(): Creates a new empty file.
Boolean canWrite(): Can we write…

--

--

Cahit Barkin Ozer
Cahit Barkin Ozer

Written by Cahit Barkin Ozer

Üretken YZ başta olmak üzere teknoloji alanındaki yenilikleri öğrenip sizlerle paylaşıyorum. Youtube Kanalım: https://www.youtube.com/@cbarkinozer

No responses yet