Lines Matching refs:pos
53 * Buffered data is stored in {@code buf}. As long as no exception occurs, 0 <= pos <= end
54 * and the data in the range [pos, end) is buffered for reading. At end of input, if there is
55 * an unterminated line, we set end == -1, otherwise end == pos. If the underlying
56 * {@code InputStream} throws an {@code IOException}, end may remain as either pos or -1.
59 private int pos;
133 // throw again if that happens; thus we need to handle end == -1 as well as end == pos.
134 if (pos >= end) {
138 for (int i = pos; i != end; ++i) {
140 int lineEnd = (i != pos && buf[i - 1] == CR) ? i - 1 : i;
141 String res = new String(buf, pos, lineEnd - pos, charset.name());
142 pos = i + 1;
148 ByteArrayOutputStream out = new ByteArrayOutputStream(end - pos + 80) {
161 out.write(buf, pos, end - pos);
166 for (int i = pos; i != end; ++i) {
168 if (i != pos) {
169 out.write(buf, pos, i - pos);
171 pos = i + 1;
184 * Reads new input data into the buffer. Call only with pos == end or end == -1,
192 pos = 0;