@Override public int read() throws IOException { if (spacesToInsert > 0) { pos++; spacesToInsert--; return ' '; } int c = super.read(); if (c == '\t') { // Fill up with spaces up to the next tab stop int spaces = tabSize - (pos % tabSize); pos++; spacesToInsert = spaces - 1; return ' '; } if (c == '\n' || c == '\r') { // Reset position on new line pos = 0; } else { pos++; } return c; }
@Override public void close() throws IOException { cleanUpClassLoaders(cleanupLoaders); super.close(); }
@Override public long skip(long n) throws IOException { count += n; return super.skip(n); }
public boolean ready() throws IOException { return pos < length || super.ready(); } }
@Override public boolean ready() { try { return super.ready(); } catch (IOException e) { throw new RuntimeException(e); } }
@Override public int read(char[] cbuf, int off, int len) throws IOException { return super.read(cbuf, off, Math.min(chunk, len)); } };
@Override public void close() throws IOException { if (lineBuf.length() > 0) { lines.add(lineBuf.toString()); lineBuf.setLength(0); } super.close(); closed = true; }
@Override public long skip(long n) throws IOException { count += n; return super.skip(n); }
@Override public boolean ready() throws IOException { ensureOpen(); return (pos < buf.length) || super.ready(); }
public int read(char[] cbuf, int off, int len) throws IOException { int nr = super.read(cbuf, off, len); if (nr == -1) { logRead(); } else { logText.append(new String(cbuf, off, nr)); } return nr; }
public void close() throws IOException { super.close(); logRead(); }
@Override public long skip(long n) throws IOException { this.aboutToRead(); return super.skip(n); }
@Override public boolean ready() throws IOException { ensureOpen(); return (pos < buf.length) || super.ready(); }
public int read() throws IOException { int c = super.read(); if (c == -1) { logRead(); } else { logText.append((char) c); } return c; }
public void close() throws IOException { super.close(); logRead(); }
/** {@inheritDoc} */ @Override public long skip(final long n) throws IOException { checkCloseInvoked("skip"); return super.skip(n); } }
public int read(char[] cbuf, int off, int len) throws IOException { int nr = super.read(cbuf, off, len); if (nr == -1) { logRead(); } else { logText.append(new String(cbuf, off, nr)); } return nr; }
/** * Really close the input. * * @see java.io.Reader#close() * * @throws IOException When an I/O error occurs. */ public void doClose() throws IOException { super.close(); }
@Override public long skip(final long pn) throws IOException { long n = pn; if (n < 0L) { throw new IllegalArgumentException("skip value is negative " + pn); } ensureOpen(); int avail = buf.length - pos; if (avail > 0) { if (n <= avail) { pos += n; return n; } else { pos = buf.length; n -= avail; } } return avail + super.skip(n); }
public int read() throws IOException { int c = super.read(); if (c == -1) { logRead(); } else { logText.append((char) c); } return c; }