if (sourceClass == null || sourceClass == StreamSource.class) {
return (T)new StreamSource(getBinaryStream(), this.getStreamFactory().getSystemId());
} else if (sourceClass == StAXSource.class) {
XMLInputFactory factory = XMLInputFactory.newInstance();
try {
return (T) new StAXSource(factory.createXMLStreamReader(getBinaryStream()));
} catch (XMLStreamException e) {
throw new SQLException(e);
}
} else if (sourceClass == SAXSource.class) {
return (T) new SAXSource(new InputSource(getBinaryStream()));