// Got an InputStream and encoding? Can create a Reader:
if (r == null && (inputEnc != null && inputEnc.length() > 0)) {
r = DefaultInputResolver.constructOptimizedReader(cfg, is, false, inputEnc);
}
InputBootstrapper bs;
if (r != null) {
bs = ReaderBootstrapper.getInstance(publicId, systemId, r, inputEnc);
// false -> not for event reader; false -> no auto-closing
mScanner = (BasicStreamReader) mStaxFactory.createSR(cfg, systemId, bs, false, false);
} else {