The Java.io.DataInputStream class lets an application read primitive Java data types from an underlying input stream in a machine-independent way.Following are the important points about DataInputStream:
An application uses a data output stream to write data that can later be read by a data input stream.
DataInputStream is not necessarily safe for multithreaded access. Thread safety is optional and is the responsibility of users of methods in this class.
Following is the declaration for Java.io.DataInputStream class:
public class DataInputStream extends FilterInputStream implements DataInput
Following are the fields for Java.io.DataInputStream class:
protected InputStream in -- This is the input stream to be filtered.
|S.N.||Constructor & Description|
This creates a DataInputStream that uses the specified underlying InputStream.
|S.N.||Method & Description|
This method reads some number of bytes from the contained input stream and stores them into the buffer array b
This method reads up to len bytes of data from the contained input stream into an array of bytes.
This method reads one input byte and returns true if that byte is nonzero, false if that byte is zero.
This method reads and returns one input byte.
This method reads two input bytes and returns a char value.
This method reads eight input bytes and returns a double value.
This method reads four input bytes and returns a float value.
This method reads some bytes from an input stream and stores them into the buffer array b.
This method reads len bytes from an input stream.
This method reads four input bytes and returns an int value.
This method reads eight input bytes and returns a long value.
This method reads two input bytes and returns a short value.
This method reads one input byte, zero-extends it to type int, and returns the result, which is therefore in the range 0 through 255.
This method reads two input bytes and returns an int value in the range 0 through 65535.
This method reads in a string that has been encoded using a modified UTF-8 format.
This method reads from the stream in a representation of a Unicode character string encoded in modified UTF-8 format; this string of characters is then returned as a String.
This method makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes.
This class inherits methods from the following classes: