}
@Override
protected void writeObjectRaw(String fieldName, BytesReference content, OutputStream bos) throws IOException {
writeFieldName(fieldName);
CBORParser parser;
if (content.hasArray()) {
parser = CborXContent.cborFactory.createParser(content.array(), content.arrayOffset(), content.length());
} else {
parser = CborXContent.cborFactory.createParser(content.streamInput());
}
try {
parser.nextToken();
generator.copyCurrentStructure(parser);
} finally {
parser.close();
}
}