예제 #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 */
         );
   }
 }
예제 #2
1
 /** Tell whether this stream supports the mark() operation. */
 public boolean markSupported() {
   if (in == null) {
     return false;
   }
   return in.markSupported();
 }
예제 #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();
 }
예제 #4
1
 /**
  * Skip characters.
  *
  * @exception IOException If an I/O error occurs
  */
 public long skip(long n) throws IOException {
   ensureOpen();
   return in.skip(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);
 }
예제 #6
0
 /**
  * Read a single character.
  *
  * @exception IOException If an I/O error occurs
  */
 public int read() throws IOException {
   ensureOpen();
   return in.read();
 }
예제 #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;
   }
 }
예제 #8
0
 /**
  * Reset the stream.
  *
  * @exception IOException If an I/O error occurs
  */
 public void reset() throws IOException {
   ensureOpen();
   in.reset();
 }