Examples of writeObjectNotNull()


Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeObjectNotNull()

        out.writeObjectNotNull(new Long(0));
        out.writeObjectNotNull(FloatSerializer.MIN_VALUE);
        out.writeObjectNotNull(FloatSerializer.MAX_VALUE);
        out.writeObjectNotNull(new Float((float) 0.0));
        out.writeObjectNotNull(DoubleSerializer.MIN_VALUE);
        out.writeObjectNotNull(DoubleSerializer.MAX_VALUE);
        out.writeObjectNotNull(new Double(0.0));

        ReadBuffer b = out.getStaticBuffer().asReadBuffer();
        assertEquals(Boolean.FALSE, serialize.readObjectNotNull(b, Boolean.class));
        assertEquals(Boolean.TRUE, serialize.readObjectNotNull(b, Boolean.class));
View Full Code Here

Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeObjectNotNull()

        out.writeObjectNotNull(FloatSerializer.MIN_VALUE);
        out.writeObjectNotNull(FloatSerializer.MAX_VALUE);
        out.writeObjectNotNull(new Float((float) 0.0));
        out.writeObjectNotNull(DoubleSerializer.MIN_VALUE);
        out.writeObjectNotNull(DoubleSerializer.MAX_VALUE);
        out.writeObjectNotNull(new Double(0.0));

        ReadBuffer b = out.getStaticBuffer().asReadBuffer();
        assertEquals(Boolean.FALSE, serialize.readObjectNotNull(b, Boolean.class));
        assertEquals(Boolean.TRUE, serialize.readObjectNotNull(b, Boolean.class));
        assertEquals(Byte.MIN_VALUE, serialize.readObjectNotNull(b, Byte.class).longValue());
View Full Code Here

Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeObjectNotNull()

        String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //26 chars
        int no = 100;
        DataOutput out = serialize.getDataOutput(128, true);
        for (int i = 0; i < no; i++) {
            String str = base + (i + 1);
            out.writeObjectNotNull(str);
        }
        ReadBuffer b = out.getStaticBuffer().asReadBuffer();
        if (printStats) log.debug(bufferStats(b));
        for (int i = 0; i < no; i++) {
            String str = base + (i + 1);
View Full Code Here

Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeObjectNotNull()

    public void largeWriteTest() {
        String base = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //26 chars
        String str = "";
        for (int i = 0; i < 100; i++) str += base;
        DataOutput out = serialize.getDataOutput(128, true);
        out.writeObjectNotNull(str);
        ReadBuffer b = out.getStaticBuffer().asReadBuffer();
        if (printStats) log.debug(bufferStats(b));
        assertEquals(str, serialize.readObjectNotNull(b, String.class));
        assertFalse(b.hasRemaining());
    }
View Full Code Here

Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeObjectNotNull()

    }

    @Test
    public void enumSerializeTest() {
        DataOutput out = serialize.getDataOutput(128, true);
        out.writeObjectNotNull(TestEnum.Two);
        ReadBuffer b = out.getStaticBuffer().asReadBuffer();
        if (printStats) log.debug(bufferStats(b));
        assertEquals(TestEnum.Two, serialize.readObjectNotNull(b, TestEnum.class));
        assertFalse(b.hasRemaining());
View Full Code Here

Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeObjectNotNull()

            TitanKey key = (TitanKey) type;
            assert key.getDataType().isInstance(value);
            if (hasGenericDataType(key)) {
                writer.writeClassAndObject(value);
            } else {
                writer.writeObjectNotNull(value);
            }
        }

        //Write signature & sort key if unique
        if (type.isUnique(dir)) {
View Full Code Here

Examples of com.thinkaurelius.titan.graphdb.database.serialize.DataOutput.writeObjectNotNull()

        return ElementType.getByName(store);
    }

    private final StaticBuffer getIndexKey(Object att) {
        DataOutput out = serializer.getDataOutput(DEFAULT_VALUE_CAPACITY, true);
        out.writeObjectNotNull(att);
        return out.getStaticBuffer();
    }

    private static final StaticBuffer getIndexValue(TitanProperty prop) {
        return VariableLong.positiveByteBuffer(new long[]{prop.getVertex().getID(), prop.getID()});
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.