Byte Streams in Java

In java programming, to perform input and output of 8-bit, Byte stream is used. Most common byte streams classes are, FileInputStream and FileOutputStream. FileInputStream : FileInputStream is used for reads one byte at a time . FileOutputStream : FileOutputStream is used for writes one byte at a time Writing Bytes Example: Write a program, to write a bytes to … Read more

Concatenate & Buffer File in Java

Here we will concatenating and store buffering files in java using BufferedInputClass and BufferedOutputClass. Concatenate: It is possible to concatenate two or more files and save in a different file. In java, by using SequenceInputStream class we can concatenate two or more files. Buffer Files: In java, we can create a buffer to store temporary … Read more

DataInputStream and DataOutputStream for primitive data

In java, a basic input-output stream provides a method for reading & writing bytes or characters in a file. If we want to read-write primitive data types (such as int, float, etc.) then we can use filter classes to filter data in the original stream. DataInputStream & DataOutputStream are two filter classes used for creating … Read more

Character Stream I/O in Java

In a java programming, like a Byte stream Character stream is also used for input-output for 16 bit. But Byte streams are used to perform input and output of 8-bit. Most common Character streams classes are, FileReader and FileWriter.  FileReader- FileReader uses for reads two bytes at a time.  FileWriter– FileWriter uses for writes two bytes at a … Read more

File and Input Output in Java

In Java programming, to perform the input-output in file handling  Java has a java.io package which contain contains nearly every class you might ever need. In file handling streams represent an input source and an output destination. Stream In java programming, a sequence of data defined as a “stream”. Simply  there are two type of … Read more