use of io.aeron.archive.codecs.CatalogHeaderEncoder in project Aeron by real-logic.
the class CatalogTest method setNextRecordingId.
private void setNextRecordingId(final long nextRecordingId) throws IOException {
try (FileChannel channel = FileChannel.open(archiveDir.toPath().resolve(CATALOG_FILE_NAME), READ, WRITE)) {
final MappedByteBuffer mappedByteBuffer = channel.map(READ_WRITE, 0, CatalogHeaderEncoder.BLOCK_LENGTH);
mappedByteBuffer.order(CatalogHeaderEncoder.BYTE_ORDER);
try {
new CatalogHeaderEncoder().wrap(new UnsafeBuffer(mappedByteBuffer), 0).nextRecordingId(nextRecordingId);
} finally {
BufferUtil.free(mappedByteBuffer);
}
}
}
use of io.aeron.archive.codecs.CatalogHeaderEncoder in project aeron by real-logic.
the class CatalogTest method setNextRecordingId.
private void setNextRecordingId(final long nextRecordingId) throws IOException {
try (FileChannel channel = FileChannel.open(archiveDir.toPath().resolve(CATALOG_FILE_NAME), READ, WRITE)) {
final MappedByteBuffer mappedByteBuffer = channel.map(READ_WRITE, 0, CatalogHeaderEncoder.BLOCK_LENGTH);
mappedByteBuffer.order(CatalogHeaderEncoder.BYTE_ORDER);
try {
new CatalogHeaderEncoder().wrap(new UnsafeBuffer(mappedByteBuffer), 0).nextRecordingId(nextRecordingId);
} finally {
BufferUtil.free(mappedByteBuffer);
}
}
}
Aggregations