protected InputSource createInputSource(Source source, String contentEncoding) { // Also attach the underlying stream to the InputSource... if(source instanceof StreamSource) { StreamSource streamSource = (StreamSource) source; InputStream inputStream; Reader reader; inputStream = getInputStream(streamSource); reader = streamSource.getReader(); if(reader == null) { if(inputStream == null) { throw new SmooksException("Invalid StreamSource. Unable to extract an InputStream (even by systemId) or Reader instance."); } reader = streamToReader(inputStream, contentEncoding); } InputSource inputSource = new InputSource(); inputSource.setByteStream(inputStream); inputSource.setCharacterStream(reader); return inputSource; } else { return new InputSource(getReader(source, contentEncoding)); } }
protected InputSource createInputSource(Source source, String contentEncoding) { // Also attach the underlying stream to the InputSource... if(source instanceof StreamSource) { StreamSource streamSource = (StreamSource) source; InputStream inputStream; Reader reader; inputStream = getInputStream(streamSource); reader = streamSource.getReader(); if(reader == null) { if(inputStream == null) { throw new SmooksException("Invalid StreamSource. Unable to extract an InputStream (even by systemId) or Reader instance."); } reader = streamToReader(inputStream, contentEncoding); } InputSource inputSource = new InputSource(); inputSource.setByteStream(inputStream); inputSource.setCharacterStream(reader); return inputSource; } else { return new InputSource(getReader(source, contentEncoding)); } }
protected InputSource createInputSource(Source source, String contentEncoding) { // Also attach the underlying stream to the InputSource... if(source instanceof StreamSource) { StreamSource streamSource = (StreamSource) source; InputStream inputStream; Reader reader; inputStream = getInputStream(streamSource); reader = streamSource.getReader(); if(reader == null) { if(inputStream == null) { throw new SmooksException("Invalid StreamSource. Unable to extract an InputStream (even by systemId) or Reader instance."); } reader = streamToReader(inputStream, contentEncoding); } InputSource inputSource = new InputSource(); inputSource.setByteStream(inputStream); inputSource.setCharacterStream(reader); return inputSource; } else { return new InputSource(getReader(source, contentEncoding)); } }
protected InputSource createInputSource(Source source, String contentEncoding) { // Also attach the underlying stream to the InputSource... if(source instanceof StreamSource) { StreamSource streamSource = (StreamSource) source; InputStream inputStream; Reader reader; inputStream = getInputStream(streamSource); reader = streamSource.getReader(); if(reader == null) { if(inputStream == null) { throw new SmooksException("Invalid StreamSource. Unable to extract an InputStream (even by systemId) or Reader instance."); } reader = streamToReader(inputStream, contentEncoding); } InputSource inputSource = new InputSource(); inputSource.setByteStream(inputStream); inputSource.setCharacterStream(reader); return inputSource; } else { return new InputSource(getReader(source, contentEncoding)); } }