// we REALLY want to pass the original reader in. This is OK with JAXB
// as it doesn't read beyond the end so the DepthXMLStreamReader state
// would be OK when it returns. The main winner is FastInfoset where parsing
// a testcase I have goes from about 300/sec to well over 1000.
DepthXMLStreamReader dr = (DepthXMLStreamReader)source;
XMLStreamReader reader = dr.getReader();
if (u.getSchema() != null) {
//validating, but we may need more namespaces
reader = findExtraNamespaces(reader);
}
obj = unmarshalWithClass ? u.unmarshal(reader, clazz) : u
.unmarshal(dr.getReader());
} else if (source instanceof XMLStreamReader) {
XMLStreamReader reader = (XMLStreamReader)source;
if (u.getSchema() != null) {
//validating, but we may need more namespaces
reader = findExtraNamespaces(reader);