@@ -56,22 +56,6 @@ final class ExtendedBufferedReader extends UnsynchronizedBufferedReader {
56
56
super (reader );
57
57
}
58
58
59
- @ Override
60
- public void mark (final int readAheadLimit ) throws IOException {
61
- lineNumberMark = lineNumber ;
62
- lastCharMark = lastChar ;
63
- positionMark = position ;
64
- super .mark (readAheadLimit );
65
- }
66
-
67
- @ Override
68
- public void reset () throws IOException {
69
- lineNumber = lineNumberMark ;
70
- lastChar = lastCharMark ;
71
- position = positionMark ;
72
- super .reset ();
73
- }
74
-
75
59
/**
76
60
* Closes the stream.
77
61
*
@@ -85,6 +69,18 @@ public void close() throws IOException {
85
69
super .close ();
86
70
}
87
71
72
+ /**
73
+ * Returns the last character that was read as an integer (0 to 65535). This will be the last character returned by
74
+ * any of the read methods. This will not include a character read using the {@link #peek()} method. If no
75
+ * character has been read then this will return {@link Constants#UNDEFINED}. If the end of the stream was reached
76
+ * on the last read then this will return {@link IOUtils#EOF}.
77
+ *
78
+ * @return the last character that was read
79
+ */
80
+ int getLastChar () {
81
+ return lastChar ;
82
+ }
83
+
88
84
/**
89
85
* Returns the current line number
90
86
*
@@ -98,18 +94,6 @@ long getLineNumber() {
98
94
return lineNumber + 1 ; // Allow for counter being incremented only at EOL
99
95
}
100
96
101
- /**
102
- * Returns the last character that was read as an integer (0 to 65535). This will be the last character returned by
103
- * any of the read methods. This will not include a character read using the {@link #peek()} method. If no
104
- * character has been read then this will return {@link Constants#UNDEFINED}. If the end of the stream was reached
105
- * on the last read then this will return {@link IOUtils#EOF}.
106
- *
107
- * @return the last character that was read
108
- */
109
- int getLastChar () {
110
- return lastChar ;
111
- }
112
-
113
97
/**
114
98
* Gets the character position in the reader.
115
99
*
@@ -119,6 +103,14 @@ long getPosition() {
119
103
return this .position ;
120
104
}
121
105
106
+ @ Override
107
+ public void mark (final int readAheadLimit ) throws IOException {
108
+ lineNumberMark = lineNumber ;
109
+ lastCharMark = lastChar ;
110
+ positionMark = position ;
111
+ super .mark (readAheadLimit );
112
+ }
113
+
122
114
@ Override
123
115
public int read () throws IOException {
124
116
final int current = super .read ();
@@ -190,4 +182,12 @@ public String readLine() throws IOException {
190
182
return buffer .toString ();
191
183
}
192
184
185
+ @ Override
186
+ public void reset () throws IOException {
187
+ lineNumber = lineNumberMark ;
188
+ lastChar = lastCharMark ;
189
+ position = positionMark ;
190
+ super .reset ();
191
+ }
192
+
193
193
}
0 commit comments