sers.put(UUID.class, new UUIDSerializer()); sers.put(java.util.regex.Pattern.class, new ToStringSerializer(java.util.regex.Pattern.class)); sers.put(Locale.class, new ToStringSerializer(Locale.class));
gen.writeBinary(_asBytes(value)); return; _appendInt((int) (msb >> 32), ch, 0); ch[8] = '-'; int i = (int) msb; _appendShort(i >>> 16, ch, 9); ch[13] = '-'; _appendShort(i, ch, 14); ch[18] = '-'; _appendShort((int) (lsb >>> 48), ch, 19); ch[23] = '-'; _appendShort((int) (lsb >>> 32), ch, 24); _appendInt((int) lsb, ch, 28);
@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); } }
private final static byte[] _asBytes(UUID uuid) { byte[] buffer = new byte[16]; long hi = uuid.getMostSignificantBits(); long lo = uuid.getLeastSignificantBits(); _appendInt((int) (hi >> 32), buffer, 0); _appendInt((int) hi, buffer, 4); _appendInt((int) (lo >> 32), buffer, 8); _appendInt((int) lo, buffer, 12); return buffer; }
private static void _appendInt(int bits, char[] ch, int offset) { _appendShort(bits >> 16, ch, offset); _appendShort(bits, ch, offset+4); }
@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); } }
private final static byte[] _asBytes(UUID uuid) { byte[] buffer = new byte[16]; long hi = uuid.getMostSignificantBits(); long lo = uuid.getLeastSignificantBits(); _appendInt((int) (hi >> 32), buffer, 0); _appendInt((int) hi, buffer, 4); _appendInt((int) (lo >> 32), buffer, 8); _appendInt((int) lo, buffer, 12); return buffer; }
private static void _appendInt(int bits, char[] ch, int offset) { _appendShort(bits >> 16, ch, offset); _appendShort(bits, ch, offset+4); }
gen.writeBinary(_asBytes(value)); return; _appendInt((int) (msb >> 32), ch, 0); ch[8] = '-'; int i = (int) msb; _appendShort(i >>> 16, ch, 9); ch[13] = '-'; _appendShort(i, ch, 14); ch[18] = '-'; _appendShort((int) (lsb >>> 48), ch, 19); ch[23] = '-'; _appendShort((int) (lsb >>> 32), ch, 24); _appendInt((int) lsb, ch, 28);
@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); } }
sers.put(UUID.class, new UUIDSerializer()); sers.put(java.util.regex.Pattern.class, sls); sers.put(Locale.class, sls);
private final static byte[] _asBytes(UUID uuid) { byte[] buffer = new byte[16]; long hi = uuid.getMostSignificantBits(); long lo = uuid.getLeastSignificantBits(); _appendInt((int) (hi >> 32), buffer, 0); _appendInt((int) hi, buffer, 4); _appendInt((int) (lo >> 32), buffer, 8); _appendInt((int) lo, buffer, 12); return buffer; }
private static void _appendInt(int bits, char[] ch, int offset) { _appendShort(bits >> 16, ch, offset); _appendShort(bits, ch, offset+4); }
gen.writeBinary(_asBytes(value)); return; _appendInt((int) (msb >> 32), ch, 0); ch[8] = '-'; int i = (int) msb; _appendShort(i >>> 16, ch, 9); ch[13] = '-'; _appendShort(i, ch, 14); ch[18] = '-'; _appendShort((int) (lsb >>> 48), ch, 19); ch[23] = '-'; _appendShort((int) (lsb >>> 32), ch, 24); _appendInt((int) lsb, ch, 28);
sers.put(UUID.class, new UUIDSerializer()); sers.put(java.util.regex.Pattern.class, sls); sers.put(Locale.class, sls);
private final static byte[] _asBytes(UUID uuid) { byte[] buffer = new byte[16]; long hi = uuid.getMostSignificantBits(); long lo = uuid.getLeastSignificantBits(); _appendInt((int) (hi >> 32), buffer, 0); _appendInt((int) hi, buffer, 4); _appendInt((int) (lo >> 32), buffer, 8); _appendInt((int) lo, buffer, 12); return buffer; }
private static void _appendInt(int bits, char[] ch, int offset) { _appendShort(bits >> 16, ch, offset); _appendShort(bits, ch, offset+4); }
gen.writeBinary(_asBytes(value)); return; _appendInt((int) (msb >> 32), ch, 0); ch[8] = '-'; int i = (int) msb; _appendShort(i >>> 16, ch, 9); ch[13] = '-'; _appendShort(i, ch, 14); ch[18] = '-'; _appendShort((int) (lsb >>> 48), ch, 19); ch[23] = '-'; _appendShort((int) (lsb >>> 32), ch, 24); _appendInt((int) lsb, ch, 28);
sers.put(UUID.class, new UUIDSerializer()); sers.put(java.util.regex.Pattern.class, sls); sers.put(Locale.class, sls);
private final static byte[] _asBytes(UUID uuid) { byte[] buffer = new byte[16]; long hi = uuid.getMostSignificantBits(); long lo = uuid.getLeastSignificantBits(); _appendInt((int) (hi >> 32), buffer, 0); _appendInt((int) hi, buffer, 4); _appendInt((int) (lo >> 32), buffer, 8); _appendInt((int) lo, buffer, 12); return buffer; }