@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 int read(char[] cbuf, int off, int len) throws IOException { return super.read(cbuf, off, Math.min(chunk, len)); } };
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 int read() throws IOException { int c = super.read(); if (c == -1) { logRead(); } else { logText.append((char) c); } return c; }
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 int read() throws IOException { int c = super.read(); if (c == -1) { logRead(); } else { logText.append((char) c); } return c; }
@Override public int read(char[] cbuf, int off, int len) throws IOException { int read = super.read(cbuf, off, len); count+=read; for (int i=off;i<off+len;i++) { if (cbuf[i] == '\n') newLines++; } return read; }
@Override public int read() throws IOException { count++; int read = super.read(); if (read == '\n') newLines++; return read; }
@Override public int read(char[] cbuf, int off, int len) throws IOException { int count = super.read(cbuf, off, len); if (count > 0) { converter.convert(cbuf, off, count); } return count; } }
@Override public int read(char[] cbuf, int off, int len) throws IOException { int count = super.read(cbuf, off, len); if (count > 0) { converter.convert(cbuf, off, count); } return count; } }
@Override public int read() throws IOException { int ch = super.read(); if (ch < 0) { return ch; } return converter.convert((char) ch); }
@Override public int read(char[] cbuf, int off, int len) throws IOException { int count = super.read(cbuf, off, len); if (count > 0) { converter.convert(cbuf, off, count); } return count; } }
@Override public int read() throws IOException { int ch = super.read(); if (ch < 0) { return ch; } return converter.convert((char) ch); }
@Override public int read() throws IOException { int ch = super.read(); if (ch < 0) { return ch; } return converter.convert((char) ch); }
@Override public int read() throws IOException { int ret = super.read(); if (ret != -1) { buffer.append((char) ret); } // If end of stream, or contains new line if (ret == -1 || ret == LOG_CHAR) { log(); } return ret; } }
@Override public int read(char[] cbuf, int off, int len) throws IOException { int ret = super.read(cbuf, off, len); if (ret != -1) { buffer.append(cbuf, off, ret); } // If end of stream, or contains new line if (ret == -1 || indexOf(cbuf, LOG_CHAR, off, ret) != -1) { // BUG this will log a unfinished line, if a string such as // "line \n unfinished" is read. log(); } return ret; }
@Override public int read() throws IOException { int n = super.read(); if (n != -1) { out.write(n); } return n; }
/** {@inheritDoc} */ @Override public int read(final char[] b) throws IOException { checkCloseInvoked("read(byte[])"); return super.read(b); }
@Override public int read(char[] cbuf, int off, int len) throws IOException { int count = super.read(cbuf, off, len); if (count > 0) { converter.convert(cbuf, off, count); } return count; } }