Element element = null;
if (stream == null) {
element = manager.load(input, (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK));
}
else {
IBeforeParsingCallback callback = (IBeforeParsingCallback) options.get(IXWTLoader.BEFORE_PARSING_CALLBACK);
InputStream inputStream = stream;
if (callback != null) {
int size = stream.read();
byte[] buffer = new byte[size];
stream.read(buffer);
String content = new String(buffer);
stream.close();
content = callback.onParsing(content);
inputStream = new ByteArrayInputStream(content.getBytes());
element = manager.load(stream, input);
}
element = manager.load(inputStream, input);
}