@@ -447,8 +447,8 @@ private void doRawStream(InputStream is, boolean lenient)
447447 throws IOException {
448448 BOMInputStream bom = new BOMInputStream (new BufferedInputStream (is , BUFFER_SIZE ), false , BOMS );
449449 BOMInputStream pis = new BOMInputStream (bom , true , XML_GUESS_BYTES );
450- String bomEnc = ( bom .hasBOM () ? bom . getBOM (). getCharsetName () : null );
451- String xmlGuessEnc = ( pis .hasBOM () ? pis . getBOM (). getCharsetName () : null );
450+ String bomEnc = bom .getBOMCharsetName ( );
451+ String xmlGuessEnc = pis .getBOMCharsetName ( );
452452 String xmlEnc = getXmlProlog (pis , xmlGuessEnc );
453453 this .encoding = calculateRawEncoding (bomEnc , xmlGuessEnc , xmlEnc , pis );
454454 this .reader = new InputStreamReader (is , encoding );
@@ -469,8 +469,8 @@ private void doHttpStream(InputStream is, String httpContentType,
469469 BOMInputStream pis = new BOMInputStream (bom , true , XML_GUESS_BYTES );
470470 String cTMime = getContentTypeMime (httpContentType );
471471 String cTEnc = getContentTypeEncoding (httpContentType );
472- String bomEnc = ( bom .hasBOM () ? bom . getBOM (). getCharsetName () : null );
473- String xmlGuessEnc = ( pis .hasBOM () ? pis . getBOM (). getCharsetName () : null );
472+ String bomEnc = bom .getBOMCharsetName ( );
473+ String xmlGuessEnc = pis .getBOMCharsetName ( );
474474 String xmlEnc = getXmlProlog (pis , xmlGuessEnc );
475475 this .encoding = calculateHttpEncoding (cTMime , cTEnc , bomEnc ,
476476 xmlGuessEnc , xmlEnc , pis , lenient );
0 commit comments