DataInputStream
DataInputStream is a Java I/O class that reads primitive Java data types from an underlying input stream in a portable binary format. It extends FilterInputStream and implements the DataInput interface, and is typically used in conjunction with DataOutputStream when a binary, platform-independent data format is required. DataInputStream reads multibyte values in big-endian order, which matches the format produced by DataOutputStream’s writeInt, writeLong, and related methods.
Constructors: DataInputStream(InputStream in). It can wrap any InputStream, and is often combined with BufferedInputStream for efficiency.
The class provides methods to read boolean, byte, unsigned byte, short, unsigned short, char, int, long, float,
Exceptions and semantics: Reading beyond end-of-stream throws EOFException; readUTF may throw UTFDataFormatException if the data is
Usage considerations: DataInputStream is commonly used to read data written by DataOutputStream. To improve performance, wrap