In our previous article, we showed how to download a file of any type from a servlet. Now for zip files, things are a bit different, in this tutorial, we...
In this tutorial, we show how to create a zip file from multiple files in Java. 1- ByteArrayOutputStream & ZipOutputStream Using ByteArrayOutputStream and ZipOutputStream classes provided by the JDK, you...
This tutorial shows several ways to write content to a text file in Java. The techniques used below are pure JDK and don’t use external libraries. 1- BufferedWriter The most...
This tutorial shows several ways for reading plain text files in Java. The techniques we use here are totally JDK built-in and don’t depend on external libraries. 1- BufferedReader The...
This tutorial shows several ways to convert a File object to a byte[] array in Java. 1- Traditional way The traditional conversion way is through using read() method of InputStream as...
This tutorial shows several ways to convert a byte[] array to File in Java. 1- Traditional way The traditional way of doing the conversion is through using FileOutputStream as the...