Methods Summary |
---|
public void | close()Close the stream. Closing a previously closed stream
has no effect.
if (in != null) {
in.close();
in = null;
}
|
private void | ensureOpen()Check to make sure that the stream has not been closed
if (in == null) {
throw new IOException(
/* #ifdef VERBOSE_EXCEPTIONS */
/// skipped "Stream closed"
/* #endif */
);
}
|
public void | mark(int readAheadLimit)Mark the present position in the stream.
ensureOpen();
if (in.markSupported()) {
in.mark(readAheadLimit);
} else {
throw new IOException(
/* #ifdef VERBOSE_EXCEPTIONS */
/// skipped "mark() not supported"
/* #endif */
);
}
|
public boolean | markSupported()Tell whether this stream supports the mark() operation.
if (in == null) {
return false;
}
return in.markSupported();
|
public int | read()Read a single character.
ensureOpen();
return in.read();
|
public int | read(char[] cbuf, int off, int len)Read characters into a portion of an array.
ensureOpen();
if ((off < 0) || (off > cbuf.length) || (len < 0) ||
((off + len) > cbuf.length) || ((off + len) < 0)) {
throw new IndexOutOfBoundsException();
} else if (len == 0) {
return 0;
}
return in.read(cbuf, off, len);
|
public boolean | ready()Tell whether this stream is ready to be read.
ensureOpen();
return in.ready();
|
public void | reset()Reset the stream.
ensureOpen();
in.reset();
|
public long | skip(long n)Skip characters.
ensureOpen();
return in.skip(n);
|