use of com.sleepycat.bind.tuple.TupleOutput in project qpid-broker-j by apache.
the class AMQShortStringEncodingTest method testWriteReadNullValues.
public void testWriteReadNullValues() {
// write into tuple output
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);
}
use of com.sleepycat.bind.tuple.TupleOutput in project qpid-broker-j by apache.
the class OrphanConfigurationRecordPurger method uuidToKey.
private TupleOutput uuidToKey(final UUID uuid) {
DatabaseEntry key = new DatabaseEntry();
TupleOutput output = new TupleOutput();
output.writeLong(uuid.getMostSignificantBits());
output.writeLong(uuid.getLeastSignificantBits());
return output;
}
use of com.sleepycat.bind.tuple.TupleOutput in project qpid-broker-j by apache.
the class UpgradeFrom7To8 method storeVirtualHostHierarchyRecord.
void storeVirtualHostHierarchyRecord(Database hierarchyDb, Transaction txn, UUID id, UUID virtualHostId) {
DatabaseEntry key = new DatabaseEntry();
DatabaseEntry value = new DatabaseEntry();
UUIDTupleBinding.getInstance().objectToEntry(virtualHostId, value);
TupleOutput tupleOutput = new TupleOutput();
tupleOutput.writeLong(id.getMostSignificantBits());
tupleOutput.writeLong(id.getLeastSignificantBits());
tupleOutput.writeString("VirtualHost");
TupleBinding.outputToEntry(tupleOutput, key);
hierarchyDb.put(txn, key, value);
}
use of com.sleepycat.bind.tuple.TupleOutput in project qpid-broker-j by apache.
the class AMQShortStringEncodingTest method testWriteReadShortStringWithLengthOver127.
public void testWriteReadShortStringWithLengthOver127() {
AMQShortString value = createString('a', 128);
// write into tuple output
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);
}
use of com.sleepycat.bind.tuple.TupleOutput in project qpid-broker-j by apache.
the class AMQShortStringEncodingTest method testWriteReadShortStringWithLengthLess127.
public void testWriteReadShortStringWithLengthLess127() {
AMQShortString value = new AMQShortString("test");
// write into tuple output
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);
}
Aggregations