1 | } else if (index >= end) {↵ | | 1 | } else if (index >= end) {↵
|
2 | return OUT_OF_BOUNDS;↵ | | 2 | return OUT_OF_BOUNDS;↵
|
3 | } else if (index == -1) {↵ | | 3 | ↵
|
4 | return lookBehind[0];↵ | | |
|
5 | } else if (index == -2) {↵ | | |
|
6 | return lookBehind[1];↵ | | |
|
7 | } else if (index < -2) {↵ | | |
|
8 | return OUT_OF_BOUNDS;↵ | | |
|
9 | } else if (index >= bufsize) {↵ | | 4 | } else if (index >= bufsize) {↵
|
10 | // Allocate more space in the buffer.↵ | | 5 | // Allocate more space in the buffer.↵
|
11 | try {↵ | | 6 | try {↵
|
12 | while (bufsize <= index) bufsize += BUFFER_INCREMENT;↵ | | 7 | while (bufsize <= index) bufsize += BUFFER_INCREMENT;↵
|
13 | br.reset();↵ | | 8 | br.reset();↵
|
14 | br.mark(bufsize);↵ | | 9 | br.mark(bufsize);↵
|
15 | br.skip(index-1);↵ | | 10 | br.skip(index-1);↵
|
16 | } catch (IOException e) { }↵ | | 11 | } catch (IOException e) { }↵
|
17 | } else if (this.index != index) {↵ | | 12 | } else if (this.index != index) {↵
|
18 | try {↵ | | 13 | try {↵
|
19 | br.reset();↵ | | 14 | br.reset();↵
|
20 | br.skip(index-1);↵ | | 15 | br.skip(index-1);↵
|
21 | } catch (IOException e) { }↵ | | 16 | } catch (IOException e) { }↵
|
22 | | | 17 | } else if (index == -1) {↵
|
| | | 18 | return lookBehind[0];↵
|
| | | 19 | } else if (index == -2) {↵
|
| | | 20 | return lookBehind[1];↵
|
| | | 21 | } else if (index < -2) {↵
|
| | | 22 | return OUT_OF_BOUNDS;↵
|
| | | 23 |
|