Jackson will not parse BOM and throws JsonParseException. UTF-8 JSON consuming implementations like JsonUtils.fromInputStream should expect and ignore it if a document contains it.
My specific problem is that I need to deserialize a document that uses a context that contains a UTF-16 BOM.
Propose to add:
public static Object fromInputStream(InputStream input) throws IOException {
// no readers from inputstreams w.o. encoding!!
BOMInputStream bOMInputStream = new BOMInputStream(input,false, ByteOrderMark.UTF_8,
ByteOrderMark.UTF_16BE, ByteOrderMark.UTF_16LE,
ByteOrderMark.UTF_32BE, ByteOrderMark.UTF_32LE );
return fromInputStream(bOMInputStream, "UTF-8");
}
Jackson will not parse BOM and throws JsonParseException. UTF-8 JSON consuming implementations like
JsonUtils.fromInputStreamshould expect and ignore it if a document contains it.My specific problem is that I need to deserialize a document that uses a context that contains a UTF-16 BOM.
Propose to add: