Skip to content

Tag Archives: Java-Files

In Java, we can store the content of the file into an array either by reading the file using a scanner or bufferedReader or FileReader… Read More
FileReader is a class in the java.io package which can be used to read a stream of characters from the files. This class uses either… Read More
A demo file on the desktop named ‘gfg.txt’ is used for reference as a local directory on the machine. Creating an empty file before writing… Read More
There are multiple ways of writing and reading a text file. This is required while dealing with many applications. There are several ways to read… Read More
Here, we will go through the different ways to convert file to byte array in Java. Note: Keep a check that prior doing anything first.… Read More
As we are well verse with this topic let us put more stress in order to figure out minute differences between them. Here we are… Read More
JAR stands for Java Archive file. It is a platform–independent file format that allows bundling and packaging all files associated with java application, class files,… Read More
Memory-mapped files are casual special files in Java that help to access content directly from memory. Java Programming supports memory-mapped files with java.nio package.  Memory-mapped… Read More
There are mainly 3 ways to copy files using java language. They are as given below: Using File Stream (Naive method) Using FileChannel Class Using… Read More
The copy() method of java.nio.file.Files Class is used to copy bytes from a file to I/O streams or from I/O streams to a file. I/O… Read More
The createTempDirectory() method of java.nio.file.Files Class is used to create a new directory using the given prefix and attributes. The given prefix acts as the… Read More
The in-built File.length() method in java can be used to get file size in java. The length() function is a part of the File class… Read More
We can use FilenameFilter in Java to override the accept(File dir, String name) method to execute the file filtering operation. Filename interface has a method… Read More
In the case of a multi-threaded program, where multiple threads are in execution concurrently, we require locks to be acquired and released to maintain synchronization… Read More
Primarily, java does not have any function or package that will create a password-protected zip file without using some native codes. Java has some useful… Read More

Start Your Coding Journey Now!