Home » dataoutputstream

Tag Archives: dataoutputstream

java.io.EOFException – How to solve EOFException

Bipartite Graph

In this tutorial we will discuss about the EOFException in Java. This exception indicates the the end of file (EOF), or the end of stream has been reached unexpectedly. Also, this exception is mainly used by DataInputStreams, in order to signal the end of stream. However, notice that other input operations may return a special value upon the end of ...

Read More »

Write String as chars to file with DataOutputStream

Bipartite Graph

This is an example of how to write a String as chars to a File using a DataOutputStream. The DataOutputStream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in. To write a String as chars to a File ...

Read More »

Write String as bytes to file with DataOutputStream

Bipartite Graph

In this example we shall show you how to write a String as bytes to file with the DataOutputStream. The DataOutputStream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in. To write a String as bytes to file ...

Read More »

Write char to file with DataOutputStream

Bipartite Graph

With this example we are going to demonstrate how to write a char to a file with the DataOutputStream. The DataOutputStream lets an application write primitive Java data types to an output stream in a portable way. An application can then use a data input stream to read the data back in. In short, to write a char to a ...

Read More »