@Override public int read(char[] cbuf, int off, int len) throws IOException { if (len <= 0) return 0; int c = this.read(); if (c == -1) return -1; int n = 1; // SUPPRESS CHECKSTYLE UsageDistance for (;;) { cbuf[off++] = (char) c; if (--len == 0) return n; c = this.read(); if (c == -1) return n; n++; } } }
cr = new CountingReader(br); } catch (Exception pe) { throw new BuildException( "Line " + cr.lineNumber() + ", column " + cr.columnNumber() + ": " + pe.getMessage(), pe );
@Override public int read(char[] cbuf, int off, int len) throws IOException { if (len <= 0) return 0; int c = this.read(); if (c == -1) return -1; int n = 1; // SUPPRESS CHECKSTYLE UsageDistance for (;;) { cbuf[off++] = (char) c; if (--len == 0) return n; c = this.read(); if (c == -1) return n; n++; } } }