// it should be faster to read the inputstream directly.
// but makes it difficult to troubleshoot
this.responseAsDocument =
builders.get().parse(new ByteArrayInputStream(asString().getBytes("UTF-8")));
} catch (SAXException saxe) {
throw new WeiboException("The response body was not well-formed:\n" + responseAsString,
saxe);
} catch (IOException ioe) {
throw new WeiboException("There's something with the connection.", ioe);
}
}
return responseAsDocument;
}