strangedb/src/main/java/org/warp/cowdb/IReferencesIO.java

38 lines
871 B
Java

package org.warp.cowdb;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
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;
}