java.io.DataInputStream (JDK 1.0)
This class is a type of FilterInputStream that allows you to read binary representations of Java primitive data types in a portable way. Create a DataInputStream by specifying the InputStream that is to be filtered in the call to the constructor.
Many of this class's methods read and return a single Java primitive type, in binary format, from the stream. readUnsignedByte() and readUnsignedShort() read unsigned values and return them as int values, since unsigned byte and short types are not supported in Java. read() reads data into an array of bytes, blocking until at least some data are available. By contrast, readFully() reads data into an array of bytes, but blocks until all of the requested data become available. skipBytes() blocks until the specified number of bytes have been read and discarded.
readLine() reads characters from the stream until it encounters a newline, a carriage return, or a newline carriage return pair. The returned string is not terminated with a newline or carriage return. This method is deprecated in Java 1.1; see BufferedReader for an alternative. readUTF() reads a string of Unicode text encoded in a slightly modified version of the UTF-8 "transformation format." UTF-8 is an ASCII-compatible encoding of Unicode characters that is often used for the transmission and storage of Unicode text. This class uses a modified UTF-8 encoding that never contains embedded null characters.
DataInputStream only reads primitive Java types. Use ObjectInputStream to read object values.
public classDataInputStreamextends FilterInputStream implements DataInput { //Public ConstructorpublicDataInputStream(InputStreamin); //Class Methodspublic static final StringreadUTF(DataInputin) throws IOException; //Public Instance Methodspublic final intread(byte[]b) throws IOException; //Overrides FilterInputStreampublic final intread(byte[]b, intoff, intlen) throws IOException; //Overrides FilterInputStreampublic final booleanreadBoolean() throws IOException; //From DataInputpublic final bytereadByte() throws IOException; //From DataInputpublic final charreadChar() throws IOException; //From DataInputpublic final doublereadDouble() throws IOException; //From DataInputpublic final floatreadFloat() throws IOException; //From DataInputpublic final voidreadFully(byte[]b) throws IOException; //From DataInputpublic final voidreadFully(byte[]b, intoff, intlen) throws IOException; //From DataInputpublic final intreadInt() throws IOException; //From DataInput# public final StringreadLine() throws IOException; //From DataInputpublic final longreadLong() throws IOException; //From DataInputpublic final shortreadShort() throws IOException; //From DataInputpublic final StringreadUTF() throws IOException; //From DataInputpublic final intreadUnsignedByte() throws IOException; //From DataInputpublic final intreadUnsignedShort() throws IOException; //From DataInputpublic final intskipBytes(intn) throws IOException; //From DataInput}
Hierarchy:
Object->InputStream->FilterInputStream->DataInputStream(DataInput)