|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
java.io.DataInputStream
public class DataInputStream
A data input stream lets an application read primitive Java data types from an underlying input stream in a machine-independent way. An application uses a data output stream to write data that can later be read by a data input stream.
| Field Summary | |
|---|---|
protected InputStream |
in
The input stream. |
| Constructor Summary | |
|---|---|
DataInputStream(InputStream in)
Creates a DataInputStream and saves its argument, the input stream in, for later use. |
|
| Method Summary | |
|---|---|
int |
available()
Returns the number of bytes that can be read from this input stream without blocking. |
void |
close()
Closes this input stream and releases any system resources associated with the stream. |
void |
mark(int readlimit)
Marks the current position in this input stream. |
boolean |
markSupported()
Tests if this input stream supports the mark and reset methods. |
int |
read()
Reads the next byte of data from this input stream. |
int |
read(byte[] b)
See the general contract of the read method of DataInput. |
int |
read(byte[] b,
int off,
int len)
Reads up to len bytes of data from this input stream into an array of bytes. |
boolean |
readBoolean()
See the general contract of the readBoolean method of DataInput. |
byte |
readByte()
See the general contract of the readByte method of DataInput. |
char |
readChar()
See the general contract of the readChar method of DataInput. |
double |
readDouble()
See the general contract of the readDouble method of DataInput. |
float |
readFloat()
See the general contract of the readFloat method of DataInput. |
void |
readFully(byte[] b)
See the general contract of the readFully method of DataInput. |
void |
readFully(byte[] b,
int off,
int len)
See the general contract of the readFully method of DataInput. |
int |
readInt()
See the general contract of the readInt method of DataInput. |
long |
readLong()
See the general contract of the readLong method of DataInput. |
short |
readShort()
See the general contract of the readShort method of DataInput. |
int |
readUnsignedByte()
See the general contract of the readUnsignedByte method of DataInput. |
int |
readUnsignedShort()
See the general contract of the readUnsignedShort method of DataInput. |
String |
readUTF()
See the general contract of the readUTF method of DataInput. |
static String |
readUTF(DataInput in)
Reads from the stream in a representation of a Unicode character string encoded in Java modified UTF-8 format; this string of characters is then returned as a String. |
void |
reset()
Repositions this stream to the position at the time the mark method was last called on this input stream. |
long |
skip(long n)
Skips over and discards n bytes of data from the input stream. |
int |
skipBytes(int n)
See the general contract of the skipBytes method of DataInput. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected InputStream in
| Constructor Detail |
|---|
public DataInputStream(InputStream in)
| Method Detail |
|---|
public int available()
throws IOException
available in class InputStreamIOException
public void close()
throws IOException
close in class InputStreamIOExceptionpublic void mark(int readlimit)
mark in class InputStreampublic boolean markSupported()
markSupported in class InputStream
public int read()
throws IOException
read in class InputStreamIOException
public final int read(byte[] b)
throws IOException
read in class InputStreamIOException
public final int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOException
public final boolean readBoolean()
throws IOException
readBoolean in interface DataInputIOException
public final byte readByte()
throws IOException
readByte in interface DataInputIOException
public final char readChar()
throws IOException
readChar in interface DataInputIOException
public final double readDouble()
throws IOException
readDouble in interface DataInputIOException
public final float readFloat()
throws IOException
readFloat in interface DataInputIOException
public final void readFully(byte[] b)
throws IOException
readFully in interface DataInputIOException
public final void readFully(byte[] b,
int off,
int len)
throws IOException
readFully in interface DataInputIOException
public final int readInt()
throws IOException
readInt in interface DataInputIOException
public final long readLong()
throws IOException
readLong in interface DataInputIOException
public final short readShort()
throws IOException
readShort in interface DataInputIOException
public final int readUnsignedByte()
throws IOException
readUnsignedByte in interface DataInputIOException
public final int readUnsignedShort()
throws IOException
readUnsignedShort in interface DataInputIOException
public final String readUTF()
throws IOException
readUTF in interface DataInputIOException
public static final String readUTF(DataInput in)
throws IOException
IOException
public void reset()
throws IOException
reset in class InputStreamIOException
public long skip(long n)
throws IOException
skip in class InputStreamIOException
public final int skipBytes(int n)
throws IOException
skipBytes in interface DataInputIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||