public class CompressedAppendableFile
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
PAGE_LENGTH |
Constructor and Description |
---|
CompressedAppendableFile(java.nio.file.Path file) |
Modifier and Type | Method and Description |
---|---|
void |
append(byte[] buffer,
int size) |
void |
append(byte[] buffer,
int offset,
int size) |
<Data> void |
append(Data value,
KeyDescriptor<Data> descriptor) |
protected int |
compress(DataOutputStream compressedDataOut,
byte[] buffer) |
protected byte [] |
decompress(java.io.DataInputStream keysStream) |
void |
dispose() |
void |
force() |
protected java.io.InputStream |
getChunkInputStream(java.nio.file.Path appendFile,
long offset,
int pageSize) |
protected java.nio.file.Path |
getChunkLengthFile() |
protected java.nio.file.Path |
getChunksFile() |
java.io.DataInputStream |
getStream(long addr) |
int |
hashCode() |
boolean |
isDirty() |
long |
length() |
<Data> Data |
read(long addr,
KeyDescriptor<Data> descriptor) |
protected void |
saveChunk(BufferExposingByteArrayOutputStream compressedChunk,
long endOfFileOffset) |
public CompressedAppendableFile(java.nio.file.Path file) throws java.io.IOException
java.io.IOException
public <Data> Data read(long addr, KeyDescriptor<Data> descriptor) throws java.io.IOException
java.io.IOException
public java.io.DataInputStream getStream(long addr) throws java.io.IOException
java.io.IOException
protected java.nio.file.Path getChunkLengthFile()
protected java.io.InputStream getChunkInputStream(java.nio.file.Path appendFile, long offset, int pageSize) throws java.io.IOException
java.io.IOException
public <Data> void append(Data value, KeyDescriptor<Data> descriptor) throws java.io.IOException
java.io.IOException
public void append(byte[] buffer, int size) throws java.io.IOException
java.io.IOException
public void append(byte[] buffer, int offset, int size) throws java.io.IOException
java.io.IOException
protected int compress(DataOutputStream compressedDataOut, byte[] buffer) throws java.io.IOException
java.io.IOException
protected byte [] decompress(java.io.DataInputStream keysStream) throws java.io.IOException
java.io.IOException
protected void saveChunk(BufferExposingByteArrayOutputStream compressedChunk, long endOfFileOffset) throws java.io.IOException
java.io.IOException
protected java.nio.file.Path getChunksFile()
public void force()
public void dispose()
public long length()
public boolean isDirty()
public int hashCode()
hashCode
in class java.lang.Object