Examples of TupleInput


Examples of com.sleepycat.bind.tuple.TupleInput

        for (int i=0; i < hex.length(); i+=2) {
            int value = Character.digit(hex.charAt(i),16);
            value |= Character.digit(hex.charAt(i+1),16) << 4;
            buffer[i >> 1] = (byte)value;
        }
        TupleInput tuple = new TupleInput(buffer);
        return binding.entryToObject(tuple);
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        TupleOutput tupleOutput = new TupleOutput();
        AMQShortStringEncoding.writeShortString(null, tupleOutput);
        byte[] data = tupleOutput.getBufferBytes();

        // read from tuple input
        TupleInput tupleInput = new TupleInput(data);
        AMQShortString result = AMQShortStringEncoding.readShortString(tupleInput);
        assertNull("Expected null but got " + result, result);
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        TupleOutput tupleOutput = new TupleOutput();
        AMQShortStringEncoding.writeShortString(value, tupleOutput);
        byte[] data = tupleOutput.getBufferBytes();

        // read from tuple input
        TupleInput tupleInput = new TupleInput(data);
        AMQShortString result = AMQShortStringEncoding.readShortString(tupleInput);
        assertEquals("Expected " + value + " but got " + result, value, result);
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        TupleOutput tupleOutput = new TupleOutput();
        AMQShortStringEncoding.writeShortString(value, tupleOutput);
        byte[] data = tupleOutput.getBufferBytes();

        // read from tuple input
        TupleInput tupleInput = new TupleInput(data);
        AMQShortString result = AMQShortStringEncoding.readShortString(tupleInput);
        assertEquals("Expected " + value + " but got " + result, value, result);
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

                                      DatabaseEntry dataEntry,
                                      DatabaseEntry indexKeyEntry)
        throws DatabaseException {

        TupleOutput output = getTupleOutput(null);
        TupleInput primaryKeyInput = entryToInput(primaryKeyEntry);
        Object dataInput = dataBinding.entryToObject(dataEntry);
        if (createSecondaryKey(primaryKeyInput, dataInput, output)) {
            outputToEntry(output, indexKeyEntry);
            return true;
        } else {
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        throws Exception {

        to.reset();
        new Data().writeTuple(to);

        TupleInput ti = new TupleInput(
                          to.getBufferBytes(), to.getBufferOffset(),
                          to.getBufferLength());
        new Data().readTuple(ti);

        return to.getBufferLength();
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        TupleOutput output = new TupleOutput();
        output.writeString("abc");
        binding.objectToEntry(val, output);
        output.writeString("xyz");

        TupleInput input = new TupleInput(output);
        assertEquals("abc", input.readString());
        Object val3 = binding.entryToObject(input);
        assertEquals("xyz", input.readString());

        assertEquals(0, input.available());
        assertSame(compareCls, val3.getClass());
        assertEquals(val, val3);
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        EntryBinding binding = new TupleInputBinding();

        TupleOutput out = new TupleOutput();
        out.writeString("abc");
        binding.objectToEntry(new TupleInput(out), buffer);
        assertEquals(4, buffer.getSize());

        Object result = binding.entryToObject(buffer);
        assertTrue(result instanceof TupleInput);
        TupleInput in = (TupleInput) result;
        assertEquals("abc", in.readString());
        assertEquals(0, in.available());
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        TupleOutput tupleOutput = new TupleOutput();
        AMQShortStringEncoding.writeShortString(null, tupleOutput);
        byte[] data = tupleOutput.getBufferBytes();

        // read from tuple input
        TupleInput tupleInput = new TupleInput(data);
        AMQShortString result = AMQShortStringEncoding.readShortString(tupleInput);
        assertNull("Expected null but got " + result, result);
    }
View Full Code Here

Examples of com.sleepycat.bind.tuple.TupleInput

        TupleOutput tupleOutput = new TupleOutput();
        AMQShortStringEncoding.writeShortString(value, tupleOutput);
        byte[] data = tupleOutput.getBufferBytes();

        // read from tuple input
        TupleInput tupleInput = new TupleInput(data);
        AMQShortString result = AMQShortStringEncoding.readShortString(tupleInput);
        assertEquals("Expected " + value + " but got " + result, value, result);
    }
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.