@@ -56,22 +56,6 @@ final class ExtendedBufferedReader extends UnsynchronizedBufferedReader {
5656 super (reader );
5757 }
5858
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-
7559 /**
7660 * Closes the stream.
7761 *
@@ -85,6 +69,18 @@ public void close() throws IOException {
8569 super .close ();
8670 }
8771
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+
8884 /**
8985 * Returns the current line number
9086 *
@@ -98,18 +94,6 @@ long getLineNumber() {
9894 return lineNumber + 1 ; // Allow for counter being incremented only at EOL
9995 }
10096
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-
11397 /**
11498 * Gets the character position in the reader.
11599 *
@@ -119,6 +103,14 @@ long getPosition() {
119103 return this .position ;
120104 }
121105
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+
122114 @ Override
123115 public int read () throws IOException {
124116 final int current = super .read ();
@@ -190,4 +182,12 @@ public String readLine() throws IOException {
190182 return buffer .toString ();
191183 }
192184
185+ @ Override
186+ public void reset () throws IOException {
187+ lineNumber = lineNumberMark ;
188+ lastChar = lastCharMark ;
189+ position = positionMark ;
190+ super .reset ();
191+ }
192+
193193}
0 commit comments