package org.warp.cowdb; import java.io.*; import java.nio.ByteBuffer; public interface IFileIO { /** * Read *length* bytes in position *index* * @param index index * @param length length * @return bytes */ ByteBuffer readAt(long index, int length) throws IOException; /** * Write *length* bytes in position *index* * @param index index * @param length length * @param data bytes */ void writeAt(long index, int length, ByteBuffer data) throws IOException; /** * Write *length* bytes in position *index* * @param length length * @param data bytes * @return index */ long writeAtEnd(int length, ByteBuffer data) throws IOException; /** * Close the file */ void close() throws IOException; }