/*
* @(#)DataInputStream.java 1.00 01/12/14
*
* Adapted from the original Sun Microsystems code for leJOS.
* @author Brian Bagnall
*/
package java.io;
public class DataInputStream extends InputStream {
protected InputStream in;
public DataInputStream(InputStream in) {
this.in = in;
}
/**
* Reads the next byte of data from this input stream. The value
* byte is returned as an int
in the range
* 0
to 255
. If no byte is available
* because the end of the stream has been reached, the value
* -1
is returned. This method blocks until input data
* is available, the end of the stream is detected, or an exception
* is thrown.
*
* This method
* simply performs in.read()
and returns the result.
*
* @return the next byte of data, or -1
if the end of the
* stream is reached.
* @exception IOException if an I/O error occurs.
* @see java.io.FilterInputStream#in
*/
public int read() throws IOException {
return in.read();
}
public final int read(byte b[]) throws IOException {
return in.read(b, 0, b.length);
}
public final int read(byte b[], int off, int len) throws IOException {
return in.read(b, off, len);
}
/*
public final void readFully(byte b[]) throws IOException {
readFully(b, 0, b.length);
}
*/
/* public final void readFully(byte b[], int off, int len) throws IOException {
if (len < 0)
throw new IOException();
int n = 0;
while (n < len) {
int count = in.read(b, off + n, len - n);
if (count < 0)
throw new IOException();
n += count;
}
}
*/
/* public final int skipBytes(int n) throws IOException {
int total = 0;
int cur = 0;
while ((total