public class ByteArrayRandomAccessBuffer extends java.lang.Object implements LockableRandomAccessBuffer, java.io.Serializable
LockableRandomAccessBuffer.RAFLock| Modifier | Constructor and Description |
|---|---|
protected |
ByteArrayRandomAccessBuffer() |
|
ByteArrayRandomAccessBuffer(byte[] padded) |
|
ByteArrayRandomAccessBuffer(byte[] initialContents,
int offset,
int size,
boolean readOnly) |
|
ByteArrayRandomAccessBuffer(int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
free()
Free the underlying resources.
|
boolean |
isReadOnly() |
LockableRandomAccessBuffer.RAFLock |
lockOpen()
Keep the RAF open.
|
void |
onResume(ClientContext context)
Called on resuming, i.e.
|
void |
pread(long fileOffset,
byte[] buf,
int bufOffset,
int length)
Read a block of data from a specific location in the file.
|
void |
pwrite(long fileOffset,
byte[] buf,
int bufOffset,
int length) |
void |
setReadOnly() |
long |
size() |
void |
storeTo(java.io.DataOutputStream dos)
Write enough data to reconstruct the Bucket, or throw UnsupportedOperationException.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitequals, hashCodepublic ByteArrayRandomAccessBuffer(byte[] padded)
public ByteArrayRandomAccessBuffer(int size)
public ByteArrayRandomAccessBuffer(byte[] initialContents,
int offset,
int size,
boolean readOnly)
protected ByteArrayRandomAccessBuffer()
public void close()
close in interface RandomAccessBufferclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic void pread(long fileOffset,
byte[] buf,
int bufOffset,
int length)
throws java.io.IOException
RandomAccessBufferpread in interface RandomAccessBufferfileOffset - The offset within the file to read from.buf - The buffer to write to.bufOffset - The offset within the buffer to the first read byte.length - The length of data to read.java.io.IOException - If we were unable to read the required number of bytes etc.public void pwrite(long fileOffset,
byte[] buf,
int bufOffset,
int length)
throws java.io.IOException
pwrite in interface RandomAccessBufferjava.io.IOExceptionpublic long size()
size in interface RandomAccessBufferpublic void setReadOnly()
public boolean isReadOnly()
public LockableRandomAccessBuffer.RAFLock lockOpen()
LockableRandomAccessBufferlockOpen in interface LockableRandomAccessBufferpublic void free()
RandomAccessBufferfree in interface RandomAccessBufferpublic void onResume(ClientContext context)
LockableRandomAccessBufferonResume in interface LockableRandomAccessBufferpublic void storeTo(java.io.DataOutputStream dos)
LockableRandomAccessBufferstoreTo in interface LockableRandomAccessBuffer