我该怎么做?
我试过了:
String a = "my_byte_buffer_copied_from_my_logs";
value = ByteBuffer.wrap(a.getBytes(StandardCharsets.UTF_8));
InputStream callbackRequest = new ByteArrayInputStream(value.array());
return jaxbContext.createUnmarshaller().unmarshal(callbackRequest);
但它失败了这条消息:
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
这似乎表明XML is not valid
仅供参考,我知道编码UTF-8是正确的。