Package org.bson.types

Examples of org.bson.types.MaxKey


        } else if (b.containsField("$ref")) {
            o = new DBRef(null, (String) b.get("$ref"), b.get("$id"));
        } else if (b.containsField("$minKey")) {
            o = new MinKey();
        } else if (b.containsField("$maxKey")) {
            o = new MaxKey();
        } else if (b.containsField("$uuid")) {
            o = UUID.fromString((String) b.get("$uuid"));
        } else if (b.containsField("$binary")) {
            int type = (Integer) b.get("$type");
            byte[] bytes = (new Base64Codec()).decode((String) b.get("$binary"));
View Full Code Here


        MinKey key2 = (MinKey) objectInputStream.readObject();
    }

    @Test
    public void testSerializeMaxKey() throws Exception {
        MaxKey key = new MaxKey();

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);

        objectOutputStream.writeObject(key);

        ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
        ObjectInputStream objectInputStream = new ObjectInputStream(inputStream);
        MaxKey key2 = (MaxKey) objectInputStream.readObject();
    }
View Full Code Here

TOP

Related Classes of org.bson.types.MaxKey

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.