private void doHttpStream( InputStream is, String httpContentType, boolean lenient ) throws IOException { BufferedInputStream pis = new BufferedInputStream( is, BUFFER_SIZE ); String cTMime = getContentTypeMime( httpContentType ); String cTEnc = getContentTypeEncoding( httpContentType ); String bomEnc = getBOMEncoding( pis ); String xmlGuessEnc = getXMLGuessEncoding( pis ); String xmlEnc = getXmlProlog( pis, xmlGuessEnc ); String encoding = calculateHttpEncoding( cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc, pis, lenient ); prepareReader( pis, encoding ); }
private void doRawStream( InputStream is, boolean lenient ) throws IOException { BufferedInputStream pis = new BufferedInputStream( is, BUFFER_SIZE ); String bomEnc = getBOMEncoding( pis ); String xmlGuessEnc = getXMLGuessEncoding( pis ); String xmlEnc = getXmlProlog( pis, xmlGuessEnc ); String encoding = calculateRawEncoding( bomEnc, xmlGuessEnc, xmlEnc, pis ); prepareReader( pis, encoding ); }
doHttpStream( conn.getInputStream(), conn.getContentType(), lenient ); doLenientDetection( conn.getContentType(), ex ); doHttpStream( conn.getInputStream(), conn.getContentType(), lenient ); doLenientDetection( conn.getContentType(), ex ); doRawStream( conn.getInputStream(), lenient ); doLenientDetection( null, ex );
try doRawStream( is, lenient ); doLenientDetection( null, ex );
boolean appXml = isAppXml( cTMime ); boolean textXml = isTextXml( cTMime ); if ( appXml || textXml ) encoding = calculateRawEncoding( bomEnc, xmlGuessEnc, xmlEnc, is );
try doHttpStream( ex.getInputStream(), httpContentType, true ); ex = null; prepareReader( ex.getInputStream(), encoding );
try doHttpStream( is, httpContentType, lenient ); doLenientDetection( httpContentType, ex );
boolean appXml = isAppXml( cTMime ); boolean textXml = isTextXml( cTMime ); if ( appXml || textXml ) encoding = calculateRawEncoding( bomEnc, xmlGuessEnc, xmlEnc, is );
try doHttpStream( ex.getInputStream(), httpContentType, true ); ex = null; prepareReader( ex.getInputStream(), encoding );
try doRawStream( is, lenient ); doLenientDetection( null, ex );
try doHttpStream( is, httpContentType, lenient ); doLenientDetection( httpContentType, ex );
private void doHttpStream( InputStream is, String httpContentType, boolean lenient ) throws IOException { BufferedInputStream pis = new BufferedInputStream( is, BUFFER_SIZE ); String cTMime = getContentTypeMime( httpContentType ); String cTEnc = getContentTypeEncoding( httpContentType ); String bomEnc = getBOMEncoding( pis ); String xmlGuessEnc = getXMLGuessEncoding( pis ); String xmlEnc = getXmlProlog( pis, xmlGuessEnc ); String encoding = calculateHttpEncoding( cTMime, cTEnc, bomEnc, xmlGuessEnc, xmlEnc, pis, lenient ); prepareReader( pis, encoding ); }
private void doRawStream( InputStream is, boolean lenient ) throws IOException { BufferedInputStream pis = new BufferedInputStream( is, BUFFER_SIZE ); String bomEnc = getBOMEncoding( pis ); String xmlGuessEnc = getXMLGuessEncoding( pis ); String xmlEnc = getXmlProlog( pis, xmlGuessEnc ); String encoding = calculateRawEncoding( bomEnc, xmlGuessEnc, xmlEnc, pis ); prepareReader( pis, encoding ); }
doHttpStream( conn.getInputStream(), conn.getContentType(), lenient ); doLenientDetection( conn.getContentType(), ex ); doHttpStream( conn.getInputStream(), conn.getContentType(), lenient ); doLenientDetection( conn.getContentType(), ex ); doRawStream( conn.getInputStream(), lenient ); doLenientDetection( null, ex );