package it.cavallium.strangedb.database; import java.io.IOException; import java.nio.ByteBuffer; public interface IReferencesIO { /** * Allocate a new empty reference * @return the new reference */ long allocateReference() throws IOException; /** * Allocate a new reference with that data * @param size data size * @param data bytes * @return the new reference */ long allocateReference(int size, ByteBuffer data) throws IOException; /** * Write some data to the reference * @param reference reference * @param size data size * @param data bytes */ void writeToReference(long reference, int size, ByteBuffer data) throws IOException; /** * Read data from the reference * @param reference reference * @return bytes */ ByteBuffer readFromReference(long reference) throws IOException; }