what-the-bank/sources/org/simpleframework/xml/stream/DocumentProvider.java

32 lines
1.0 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package org.simpleframework.xml.stream;
import java.io.InputStream;
import java.io.Reader;
import javax.xml.parsers.DocumentBuilderFactory;
import org.xml.sax.InputSource;
/* loaded from: classes.dex */
class DocumentProvider implements Provider {
private final DocumentBuilderFactory factory;
public DocumentProvider() {
DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
this.factory = newInstance;
newInstance.setNamespaceAware(true);
}
@Override // org.simpleframework.xml.stream.Provider
public EventReader provide(InputStream inputStream) throws Exception {
return provide(new InputSource(inputStream));
}
@Override // org.simpleframework.xml.stream.Provider
public EventReader provide(Reader reader) throws Exception {
return provide(new InputSource(reader));
}
private EventReader provide(InputSource inputSource) throws Exception {
return new DocumentReader(this.factory.newDocumentBuilder().parse(inputSource));
}
}