org.apache.activeio.journal.active.Record

Here are the examples of the java api class org.apache.activeio.journal.active.Record taken from open source projects.

1. LogFileManagerTest#appendHelloRecord()

Project: activemq-activeio
File: LogFileManagerTest.java
/**
     * @param i
     * @throws IOException
     * @throws InterruptedException
     */
private void appendHelloRecord(int i) throws IOException, InterruptedException {
    byte data[] = ("Hello World: " + i).getBytes();
    Record batchedRecord = new Record(LogFileManager.DATA_RECORD_TYPE, new ByteArrayPacket(data), null);
    batchedRecord.setLocation(logFile.getNextAppendLocation());
    BatchedWrite write = new BatchedWrite(new ByteBufferPacket(ByteBuffer.allocate(1024)));
    write.append(batchedRecord, null, true);
    write.flip();
    logFile.append(write);
}