Home » Core Java » io » DataInputStream

DataInputStream

Read char from file with DataInputStream

This is an example of how to read a char from a file with the DataInputStream. The DataInputStream lets an application read primitive Java data types from an underlying input stream in a machine-independent way. Reading a char from a file implies that you should: Create a FileInputStream by opening a connection to an actual file, the file named by ...

Read More »

Read byte array from file with DataInputStream

With this example we are going to demonstrate how to read a byte array from a file with the DataInputStream. The DataInputStream lets an application read primitive Java data types from an underlying input stream in a machine-independent way. In short, to read a byte array from a file with the DataInputStream you should: Create a FileInputStream by opening a ...

Read More »