@@ -67,6 +67,15 @@ final class ExtendedBufferedReader extends UnsynchronizedBufferedReader {
6767 super (reader );
6868 }
6969
70+ /**
71+ * Constructs a new instance with the specified reader, character set,
72+ * and byte tracking option. Initializes an encoder if byte tracking is enabled
73+ * and a character set is provided.
74+ *
75+ * @param reader the reader supports a look-ahead option.
76+ * @param charset the character set for encoding, or {@code null} if not applicable.
77+ * @param enableByteTracking {@code true} to enable byte tracking; {@code false} to disable it.
78+ */
7079 ExtendedBufferedReader (final Reader reader , Charset charset , boolean enableByteTracking ) {
7180 super (reader );
7281 if (charset != null && enableByteTracking ) {
@@ -146,7 +155,7 @@ public int read() throws IOException {
146155 }
147156
148157 /**
149- * In Java, the {@code char} data type is based on the original Unicode
158+ * Gets the byte length of the given character based on the the original Unicode
150159 * specification, which defined characters as fixed-width 16-bit entities.
151160 * <p>
152161 * The Unicode characters are divided into two main ranges:
@@ -166,6 +175,10 @@ public int read() throws IOException {
166175 * </ul>
167176 * </li>
168177 * </ul>
178+ *
179+ * @param current the current character to process.
180+ * @return the byte length of the character.
181+ * @throws CharacterCodingException if the character cannot be encoded.
169182 */
170183 private long getCharBytes (int current ) throws CharacterCodingException {
171184 final char cChar = (char ) current ;
0 commit comments