Exemplo n.º 1
1
 /**
  * Mark the present position in the stream.
  *
  * @exception IOException If an I/O error occurs
  */
 public void mark(int readAheadLimit) throws IOException {
   ensureOpen();
   if (in.markSupported()) {
     in.mark(readAheadLimit);
   } else {
     throw new IOException(
         /* #ifdef VERBOSE_EXCEPTIONS */
         /// skipped                       "mark() not supported"
         /* #endif */
         );
   }
 }
Exemplo n.º 2
1
 /** Tell whether this stream supports the mark() operation. */
 public boolean markSupported() {
   if (in == null) {
     return false;
   }
   return in.markSupported();
 }
Exemplo n.º 3
1
 /**
  * Tell whether this stream is ready to be read.
  *
  * @exception IOException If an I/O error occurs
  */
 public boolean ready() throws IOException {
   ensureOpen();
   return in.ready();
 }
Exemplo n.º 4
1
 /**
  * Skip characters.
  *
  * @exception IOException If an I/O error occurs
  */
 public long skip(long n) throws IOException {
   ensureOpen();
   return in.skip(n);
 }
Exemplo n.º 5
0
 /**
  * Read characters into a portion of an array.
  *
  * @exception IOException If an I/O error occurs
  */
 public int read(char cbuf[], int off, int len) throws IOException {
   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);
 }
Exemplo n.º 6
0
 /**
  * Read a single character.
  *
  * @exception IOException If an I/O error occurs
  */
 public int read() throws IOException {
   ensureOpen();
   return in.read();
 }
Exemplo n.º 7
0
 /**
  * Close the stream.
  *
  * @exception IOException If an I/O error occurs
  */
 public void close() throws IOException {
   if (in != null) {
     in.close();
     in = null;
   }
 }
Exemplo n.º 8
0
 /**
  * Reset the stream.
  *
  * @exception IOException If an I/O error occurs
  */
 public void reset() throws IOException {
   ensureOpen();
   in.reset();
 }