Package com.mongodb

Examples of com.mongodb.LazyDBObject


    public void shouldPipeLazyDbObject() throws Exception {

        DBEncoder encoder = BsonDBEncoder.FACTORY.create();
        BasicOutputBuffer buffer = new BasicOutputBuffer();

        encoder.writeObject(buffer, new LazyDBObject(new byte[]{5, 0, 0, 0, 0}, null));

        assertThat(buffer.toByteArray()).isEqualTo(new byte[]{5, 0, 0, 0, 0});

    }
View Full Code Here


    public byte[] toByteArray() {
        return bytes;
    }

    public DBObject toDBObject() {
        return new LazyDBObject(bytes, new LazyBSONCallback());
    }
View Full Code Here

     * @param bytes the raw BSON bytes
     * @param offset the offset into the bytes
     * @return the LazyBSONObject
     */
    public Object createObject( byte[] bytes, int offset ){
        return new LazyDBObject( bytes, offset, this );
    }
View Full Code Here

TOP

Related Classes of com.mongodb.LazyDBObject

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.