@@ -224,7 +224,7 @@ public static Builder builder() {
224224 /**
225225 * BOMs are sorted from longest to shortest.
226226 */
227- private final List <ByteOrderMark > boms ;
227+ private final List <ByteOrderMark > bomList ;
228228
229229 private ByteOrderMark byteOrderMark ;
230230 private int fbIndex ;
@@ -243,7 +243,7 @@ private BOMInputStream(final Builder builder) throws IOException {
243243 final List <ByteOrderMark > list = Arrays .asList (builder .byteOrderMarks );
244244 // Sort the BOMs to match the longest BOM first because some BOMs have the same starting two bytes.
245245 list .sort (ByteOrderMarkLengthComparator );
246- this .boms = list ;
246+ this .bomList = list ;
247247 }
248248
249249 /**
@@ -293,7 +293,7 @@ public BOMInputStream(final InputStream delegate, final boolean include, final B
293293 final List <ByteOrderMark > list = Arrays .asList (boms );
294294 // Sort the BOMs to match the longest BOM first because some BOMs have the same starting two bytes.
295295 list .sort (ByteOrderMarkLengthComparator );
296- this .boms = list ;
296+ this .bomList = list ;
297297 }
298298
299299 /**
@@ -311,12 +311,12 @@ public BOMInputStream(final InputStream delegate, final ByteOrderMark... boms) {
311311 }
312312
313313 /**
314- * Find a BOM with the specified bytes.
314+ * Find a BOM with the configured bytes in {@code bomList} .
315315 *
316316 * @return The matched BOM or null if none matched
317317 */
318318 private ByteOrderMark find () {
319- return boms .stream ().filter (this ::matches ).findFirst ().orElse (null );
319+ return bomList .stream ().filter (this ::matches ).findFirst ().orElse (null );
320320 }
321321
322322 /**
@@ -330,7 +330,7 @@ public ByteOrderMark getBOM() throws IOException {
330330 if (firstBytes == null ) {
331331 fbLength = 0 ;
332332 // BOMs are sorted from longest to shortest
333- final int maxBomSize = boms .get (0 ).length ();
333+ final int maxBomSize = bomList .get (0 ).length ();
334334 firstBytes = new int [maxBomSize ];
335335 // Read first maxBomSize bytes
336336 for (int i = 0 ; i < firstBytes .length ; i ++) {
@@ -389,7 +389,7 @@ public boolean hasBOM() throws IOException {
389389 * if an error reading the first bytes of the stream occurs
390390 */
391391 public boolean hasBOM (final ByteOrderMark bom ) throws IOException {
392- if (!boms .contains (bom )) {
392+ if (!bomList .contains (bom )) {
393393 throw new IllegalArgumentException ("Stream not configured to detect " + bom );
394394 }
395395 return Objects .equals (getBOM (), bom );
0 commit comments