@@ -155,7 +155,7 @@ public static class Builder extends AbstractStreamBuilder<CSVParser, Builder> {
155155 private CSVFormat format ;
156156 private long characterOffset ;
157157 private long recordNumber = 1 ;
158- private boolean enableByteTracking ;
158+ private boolean trackBytes ;
159159
160160 /**
161161 * Constructs a new instance.
@@ -167,7 +167,7 @@ protected Builder() {
167167 @ SuppressWarnings ("resource" )
168168 @ Override
169169 public CSVParser get () throws IOException {
170- return new CSVParser (getReader (), format != null ? format : CSVFormat .DEFAULT , characterOffset , recordNumber , getCharset (), enableByteTracking );
170+ return new CSVParser (getReader (), format != null ? format : CSVFormat .DEFAULT , characterOffset , recordNumber , getCharset (), trackBytes );
171171 }
172172
173173 /**
@@ -181,18 +181,6 @@ public Builder setCharacterOffset(final long characterOffset) {
181181 return asThis ();
182182 }
183183
184- /**
185- * Sets whether to enable byte tracking for the parser.
186- *
187- * @param enableByteTracking {@code true} to enable byte tracking; {@code false} to disable it.
188- * @return this instance.
189- * @since 1.13.0
190- */
191- public Builder setEnableByteTracking (final boolean enableByteTracking ) {
192- this .enableByteTracking = enableByteTracking ;
193- return asThis ();
194- }
195-
196184 /**
197185 * Sets the CSV format. A copy of the given format is kept.
198186 *
@@ -215,6 +203,18 @@ public Builder setRecordNumber(final long recordNumber) {
215203 return asThis ();
216204 }
217205
206+ /**
207+ * Sets whether to enable byte tracking for the parser.
208+ *
209+ * @param trackBytes {@code true} to enable byte tracking; {@code false} to disable it.
210+ * @return this instance.
211+ * @since 1.13.0
212+ */
213+ public Builder setTrackBytes (final boolean trackBytes ) {
214+ this .trackBytes = trackBytes ;
215+ return asThis ();
216+ }
217+
218218 }
219219
220220 final class CSVRecordIterator implements Iterator <CSVRecord > {
@@ -544,7 +544,7 @@ public CSVParser(final Reader reader, final CSVFormat format, final long charact
544544 * The next record number to assign.
545545 * @param charset
546546 * The character encoding to be used for the reader when enableByteTracking is true.
547- * @param enableByteTracking
547+ * @param trackBytes
548548 * {@code true} to enable byte tracking for the parser; {@code false} to disable it.
549549 * @throws IllegalArgumentException
550550 * If the parameters of the format are inconsistent or if either the reader or format is null.
@@ -553,12 +553,12 @@ public CSVParser(final Reader reader, final CSVFormat format, final long charact
553553 * @throws CSVException Thrown on invalid input.
554554 */
555555 private CSVParser (final Reader reader , final CSVFormat format , final long characterOffset , final long recordNumber ,
556- final Charset charset , final boolean enableByteTracking )
556+ final Charset charset , final boolean trackBytes )
557557 throws IOException {
558558 Objects .requireNonNull (reader , "reader" );
559559 Objects .requireNonNull (format , "format" );
560560 this .format = format .copy ();
561- this .lexer = new Lexer (format , new ExtendedBufferedReader (reader , charset , enableByteTracking ));
561+ this .lexer = new Lexer (format , new ExtendedBufferedReader (reader , charset , trackBytes ));
562562 this .csvRecordIterator = new CSVRecordIterator ();
563563 this .headers = createHeaders ();
564564 this .characterOffset = characterOffset ;
0 commit comments