use of com.fasterxml.jackson.databind.ser.std.UUIDSerializer in project bson4jackson by michel-kraemer.
the class BsonUuidSerializer method serialize.
@Override
public void serialize(UUID value, JsonGenerator gen, SerializerProvider provider) throws IOException {
if (gen instanceof BsonGenerator) {
BsonGenerator bgen = (BsonGenerator) gen;
bgen.writeBinary(null, BsonConstants.SUBTYPE_UUID, uuidToLittleEndianBytes(value), 0, 16);
} else {
new UUIDSerializer().serialize(value, gen, provider);
}
}
Aggregations