/** * Resets the stream to the most recent mark, or to the beginning if it has * never been marked. * * @throws IOException If an I/O error occurs */ @Override public void reset() throws IOException { ensureOpen(); pos = markedPos; }
/** * Tells whether this stream is ready to be read. Character-array readers * are always ready to be read. * * @throws IOException If an I/O error occurs */ @Override public boolean ready() throws IOException { ensureOpen(); return (count - pos) > 0; }
/** * Resets the stream to the most recent mark, or to the beginning if it has * never been marked. * * @throws IOException If an I/O error occurs */ @Override public void reset() throws IOException { ensureOpen(); pos = markedPos; }
/** * Resets the stream to the most recent mark, or to the beginning if it has * never been marked. * * @throws IOException If an I/O error occurs */ @Override public void reset() throws IOException { ensureOpen(); pos = markedPos; }
/** * Tells whether this stream is ready to be read. Character-array readers * are always ready to be read. * * @throws IOException If an I/O error occurs */ @Override public boolean ready() throws IOException { ensureOpen(); return (count - pos) > 0; }
/** * Tells whether this stream is ready to be read. Character-array readers * are always ready to be read. * * @throws IOException If an I/O error occurs */ @Override public boolean ready() throws IOException { ensureOpen(); return (count - pos) > 0; }
/** * Reads a single character. * * @throws IOException If an I/O error occurs */ @Override public int read() throws IOException { ensureOpen(); if (pos >= count) return -1; else return buf[pos++]; }
/** * Reads a single character. * * @throws IOException If an I/O error occurs */ @Override public int read() throws IOException { ensureOpen(); if (pos >= count) return -1; else return buf[pos++]; }
/** * Reads a single character. * * @throws IOException If an I/O error occurs */ @Override public int read() throws IOException { ensureOpen(); if (pos >= count) return -1; else return buf[pos++]; }
/** * Marks the present position in the stream. Subsequent calls to reset() * will reposition the stream to this point. * * @param readAheadLimit Limit on the number of characters that may be * read while still preserving the mark. Because * the stream's input comes from a character array, * there is no actual limit; hence this argument is * ignored. * @throws IOException If an I/O error occurs */ @Override public void mark(int readAheadLimit) throws IOException { ensureOpen(); markedPos = pos; }
/** * Marks the present position in the stream. Subsequent calls to reset() * will reposition the stream to this point. * * @param readAheadLimit Limit on the number of characters that may be * read while still preserving the mark. Because * the stream's input comes from a character array, * there is no actual limit; hence this argument is * ignored. * @throws IOException If an I/O error occurs */ @Override public void mark(int readAheadLimit) throws IOException { ensureOpen(); markedPos = pos; }
/** * Marks the present position in the stream. Subsequent calls to reset() * will reposition the stream to this point. * * @param readAheadLimit Limit on the number of characters that may be * read while still preserving the mark. Because * the stream's input comes from a character array, * there is no actual limit; hence this argument is * ignored. * @throws IOException If an I/O error occurs */ @Override public void mark(int readAheadLimit) throws IOException { ensureOpen(); markedPos = pos; }
/** * Skips characters. Returns the number of characters that were skipped. * <p> * The <code>n</code> parameter may be negative, even though the * <code>skip</code> method of the {@link Reader} superclass throws * an exception in this case. If <code>n</code> is negative, then * this method does nothing and returns <code>0</code>. * * @param n The number of characters to skip * @return The number of characters actually skipped * @throws IOException If the stream is closed, or an I/O error occurs */ @Override public long skip(long n) throws IOException { ensureOpen(); if (pos + n > count) { n = count - pos; } if (n < 0) { return 0; } pos += n; return n; }
/** * Skips characters. Returns the number of characters that were skipped. * <p> * The <code>n</code> parameter may be negative, even though the * <code>skip</code> method of the {@link Reader} superclass throws * an exception in this case. If <code>n</code> is negative, then * this method does nothing and returns <code>0</code>. * * @param n The number of characters to skip * @return The number of characters actually skipped * @throws IOException If the stream is closed, or an I/O error occurs */ @Override public long skip(long n) throws IOException { ensureOpen(); if (pos + n > count) { n = count - pos; } if (n < 0) { return 0; } pos += n; return n; }
/** * Skips characters. Returns the number of characters that were skipped. * <p> * The <code>n</code> parameter may be negative, even though the * <code>skip</code> method of the {@link Reader} superclass throws * an exception in this case. If <code>n</code> is negative, then * this method does nothing and returns <code>0</code>. * * @param n The number of characters to skip * @return The number of characters actually skipped * @throws IOException If the stream is closed, or an I/O error occurs */ @Override public long skip(long n) throws IOException { ensureOpen(); if (pos + n > count) { n = count - pos; } if (n < 0) { return 0; } pos += n; return n; }
ensureOpen(); if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
ensureOpen(); if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {
ensureOpen(); if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) {