In this tutorial we will discuss the Java I/O Data Streams.
To deal with the binary I/O of primitive data type values as well as the String values Java provided the support of Data stream. DataInput or the DataOutput is the interface which is implemented by all the data streams classes.
DataInput : An interface that facilitate to read byte from the binary stream and rebuild that data into any of the Java primitive types along with this facility a String from data in the UTF-8 format can also be rebuild.
There are several classes that implements the DataInput interface. Some of them are as follows :
| Classes | Description |
| DataInputStream | DataInputStream allows your application to read the Java primitive data type values from the stream. |
| RandomAccessFile | This class provides the facility to read and write to a random access file. |
| ObjectInputStream | ObjectInputStream retrieves the previously serialized objects. |
Methods of DataInput
DataOutput : An interface that facilitate to convert the primitive types values of Java to a series ob bytes write byte to the binary stream.
There are several classes which implements the DataOutput interface. Some of them are as follows :
| Classes | Description |
| DataOutputStream | DataOutputStream allows your application to write the Java primitive data type values to the output stream. |
| RandomAccessFile | This class provides the facility to read and write to a random access file. |
| ObjectOutputStream | This class is used to write the primitive data types and graphs of Java objects into an output stream. |
Methods of DataOutput
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Java I/O Data Streams
Post your Comment