public class DataInputStream extends InputStream implements DataInput
Modifier and Type | Field and Description |
---|---|
protected InputStream |
in
The input stream.
|
Constructor and Description |
---|
DataInputStream(InputStream in)
Creates a DataInputStream and saves its argument, the input stream in, for later use.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected InputStream in
public DataInputStream(InputStream in)
public int available() throws IOException
available
in class InputStream
IOException
public void close() throws IOException
close
in interface AutoCloseable
close
in class InputStream
IOException
public void mark(int readlimit)
mark
in class InputStream
public boolean markSupported()
markSupported
in class InputStream
public int read() throws IOException
read
in class InputStream
IOException
public final int read(byte[] b) throws IOException
read
in class InputStream
IOException
public final int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
public final boolean readBoolean() throws IOException
readBoolean
in interface DataInput
IOException
public final byte readByte() throws IOException
readByte
in interface DataInput
IOException
public final char readChar() throws IOException
readChar
in interface DataInput
IOException
public final double readDouble() throws IOException
readDouble
in interface DataInput
IOException
public final float readFloat() throws IOException
readFloat
in interface DataInput
IOException
public final void readFully(byte[] b) throws IOException
readFully
in interface DataInput
IOException
public final void readFully(byte[] b, int off, int len) throws IOException
readFully
in interface DataInput
IOException
public final int readInt() throws IOException
readInt
in interface DataInput
IOException
public final long readLong() throws IOException
readLong
in interface DataInput
IOException
public final short readShort() throws IOException
readShort
in interface DataInput
IOException
public final int readUnsignedByte() throws IOException
readUnsignedByte
in interface DataInput
IOException
public final int readUnsignedShort() throws IOException
readUnsignedShort
in interface DataInput
IOException
public final String readUTF() throws IOException
readUTF
in interface DataInput
IOException
public static final String readUTF(DataInput in) throws IOException
IOException
public void reset() throws IOException
reset
in class InputStream
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public final int skipBytes(int n) throws IOException
skipBytes
in interface DataInput
IOException