Examples of asReadBuffer()


Examples of com.thinkaurelius.titan.diskstorage.StaticBuffer.asReadBuffer()

            StaticBuffer b = IDHandler.getEdgeType(id, dirID);
//            System.out.println(dirID);
//            System.out.println(getBinary(id));
//            System.out.println(getBuffer(b.asReadBuffer()));
            ReadBuffer rb = b.asReadBuffer();
            long[] vals = IDHandler.readEdgeType(rb);
            assertEquals(id,vals[0]);
            assertEquals(dirID, vals[1]);
            assertFalse(rb.hasRemaining());
View Full Code Here

Examples of com.thinkaurelius.titan.diskstorage.StaticBuffer.asReadBuffer()

            out1.writeObjectNotNull(s1);
            out2.writeObjectNotNull(s2);
            StaticBuffer b1 = out1.getStaticBuffer();
            StaticBuffer b2 = out2.getStaticBuffer();
            assertEquals(s1, serialize.readObjectNotNull(b1.asReadBuffer(), String.class));
            assertEquals(s2, serialize.readObjectNotNull(b2.asReadBuffer(), String.class));
            //todo: sort order test fails because... a bug in StaticArrayBuffer.compareTo() and ByteBuffer.compareTo(), where we ignore sign bit for 'byte' during int conversion!
            /*
             * ByteBufferUtil.java:
             * public static int compare(byte c1, byte c2) {
             *    return new Byte(c1).compareTo(new Byte(c2));
View Full Code Here

Examples of com.thinkaurelius.titan.diskstorage.StaticBuffer.asReadBuffer()

            out1.writeObjectNotNull(s1);
            out2.writeObjectNotNull(s2);
            StaticBuffer b1 = out1.getStaticBuffer();
            StaticBuffer b2 = out2.getStaticBuffer();
            assertEquals(s1, serialize.readObjectNotNull(b1.asReadBuffer(), String.class));
            assertEquals(s2, serialize.readObjectNotNull(b2.asReadBuffer(), String.class));
            assertEquals(s1 + " vs " + s2, Integer.signum(s1.compareTo(s2)), Integer.signum(b1.compareTo(b2)));
        }
    }

View Full Code Here

Examples of com.thinkaurelius.titan.diskstorage.StaticBuffer.asReadBuffer()

        for (int i = 0; i < numThreads; i++) {
            threads[i] = new Thread(new Runnable() {
                @Override
                public void run() {
                    for (int j = 0; j < 100000; j++) {
                        ReadBuffer c = b.asReadBuffer();
                        assertEquals(8, c.getLong());
                        Long l = (Long) serialize.readClassAndObject(c);
                        assertEquals(8, l.longValue());
                        TestClass c2 = serialize.readObjectNotNull(c, TestClass.class);
                    }
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.