public class PooledFileRandomAccessBufferFactory extends java.lang.Object implements LockableRandomAccessBufferFactory
Constructor and Description |
---|
PooledFileRandomAccessBufferFactory(FilenameGenerator filenameGenerator,
java.util.Random seedRandom) |
Modifier and Type | Method and Description |
---|---|
void |
enableCrypto(boolean enable) |
LockableRandomAccessBuffer |
makeRAF(byte[] initialContents,
int offset,
int size,
boolean readOnly)
Create a bucket with specified initial contents.
|
LockableRandomAccessBuffer |
makeRAF(long size)
Create a bucket.
|
public PooledFileRandomAccessBufferFactory(FilenameGenerator filenameGenerator, java.util.Random seedRandom)
public void enableCrypto(boolean enable)
public LockableRandomAccessBuffer makeRAF(long size) throws java.io.IOException
LockableRandomAccessBufferFactory
makeRAF
in interface LockableRandomAccessBufferFactory
size
- The maximum size of the data. Most factories will pre-allocate this space, and
it may not be exceeded. However we do not guarantee that any I/O operation will complete;
even if we have pre-allocated the disk space, we may be unable to write to it because of
e.g. a hardware error.java.io.IOException
- If an I/O error prevented the operation.public LockableRandomAccessBuffer makeRAF(byte[] initialContents, int offset, int size, boolean readOnly) throws java.io.IOException
LockableRandomAccessBufferFactory
makeRAF
in interface LockableRandomAccessBufferFactory
initialContents
- Byte array from which to copy data. Data will be copied even if the
underlying implementation is a byte array, for reasons of consistency.offset
- Offset within the array to start copying data from.size
- Number of bytes to copy i.e. length of the new RandomAccessBuffer.java.io.IOException
- If an I/O error prevented the operation.