/** * See the general contract of the <code>reset</code> * method of <code>InputStream</code>. * <p> * If <code>markpos</code> is <code>-1</code> * (no mark has been set or the mark has been * invalidated), an <code>IOException</code> * is thrown. Otherwise, <code>pos</code> is * set equal to <code>markpos</code>. * * @exception IOException if this stream has not been marked or * if the mark has been invalidated. * @see #mark(int) */ public synchronized void reset() throws IOException { ensureOpen(); if (markpos < 0) throw new IOException("Resetting to invalid mark"); pos = markpos; }
/** * See the general contract of the <code>reset</code> * method of <code>InputStream</code>. * <p> * If <code>markpos</code> is <code>-1</code> * (no mark has been set or the mark has been * invalidated), an <code>IOException</code> * is thrown. Otherwise, <code>pos</code> is * set equal to <code>markpos</code>. * * @exception IOException if this stream has not been marked or * if the mark has been invalidated. * @see #mark(int) */ @Override public synchronized void reset() throws IOException { ensureOpen(); if (markpos < 0) throw new IOException("Resetting to invalid mark"); pos = markpos; }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ @Override public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * See the general contract of the <code>read</code> * method of <code>InputStream</code>. * * @return the next byte of data, or <code>-1</code> if the end of the * stream is reached. * @exception IOException if an I/O error occurs. */ public synchronized int read() throws IOException { ensureOpen(); if (pos >= count) { fill(); if (pos >= count) return -1; } return buf[pos++] & 0xff; }
/** * See the general contract of the <code>read</code> * method of <code>InputStream</code>. * * @return the next byte of data, or <code>-1</code> if the end of the * stream is reached. * @exception IOException if an I/O error occurs. */ @Override public synchronized int read() throws IOException { ensureOpen(); if (pos >= count) { fill(); if (pos >= count) return -1; } return buf[pos++] & 0xff; }
ensureOpen(); if (n <= 0) { return 0;
ensureOpen(); if (n <= 0) { return 0;
throws IOException ensureOpen(); if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException();
throws IOException ensureOpen(); if ((off | len | (off + len) | (b.length - (off + len))) < 0) { throw new IndexOutOfBoundsException();
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ @Override public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ @Override public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ @Override public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ @Override public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ @Override public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * Returns the number of bytes that can be read from this input * stream without blocking. * * @return the number of bytes that can be read from this input * stream without blocking. * @exception IOException if an I/O error occurs. */ @Override public synchronized int available() throws IOException { ensureOpen(); return (count - pos) + in_available(); }
/** * See the general contract of the <code>read</code> * method of <code>InputStream</code>. * * @return the next byte of data, or <code>-1</code> if the end of the * stream is reached. * @exception IOException if an I/O error occurs. */ public synchronized int read() throws IOException { ensureOpen(); if (pos >= count) { fill(); if (pos >= count) return -1; } return buf[pos++] & 0xff; }
/** * See the general contract of the <code>read</code> * method of <code>InputStream</code>. * * @return the next byte of data, or <code>-1</code> if the end of the * stream is reached. * @exception IOException if an I/O error occurs. */ public synchronized int read() throws IOException { ensureOpen(); if (pos >= count) { fill(); if (pos >= count) return -1; } return buf[pos++] & 0xff; }