public static void write(JsonParser parser, OutputStream out) {
try {
JsonFactory jsonFactory = getJsonFactory();
JsonGenerator generator = jsonFactory.createJsonGenerator(out, JsonEncoding.UTF8);
JsonNode node = parser.readValueAs(JsonNode.class);
generator.writeTree(node);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}