Learn to append content to file in java using BufferedWritter, PrintWriter, FileOutputStream and Files class. In all the examples, while opening the file to write, you have pass a second argument as true which denotes that file is opened in append mode. Table of Contents Append to File using BufferedWritter Append to File using PrintWriter […]
When working on enterprise application, sometimes it is needed to write files in java e.g. writing reports in filesystem.. Though, there are multiple ways to do so, let’s quickly go through few of them for quick reference when it is needed.
Learn to read typesafe user inputs from console in any interactive java application i.e. prompt the user until user inputs the value in correct format/datatype.
Learn to read file content into string in java. Examples use Files.readAllBytes, Files.lines and FileReader & BufferedReader to read file content.
In this java example, we will learn to convert OutputStream to InputStream which you may need when you read data from one source which return an outputstream; and write/pass the data to other target which wants data in inputstream.