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 »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns