public class DelayedFreeRandomAccessBuffer extends java.lang.Object implements LockableRandomAccessBuffer, java.io.Serializable, DelayedFree
LockableRandomAccessBuffer.RAFLock| Constructor and Description |
|---|
DelayedFreeRandomAccessBuffer(java.io.DataInputStream dis,
FilenameGenerator fg,
PersistentFileTracker persistentFileTracker,
MasterSecret masterSecret) |
DelayedFreeRandomAccessBuffer(LockableRandomAccessBuffer raf,
PersistentFileTracker factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
equals(java.lang.Object obj)
Two DelayedFreeBucket's for the same underlying can only happen on resume, in which case
we DO want them to compare as equal.
|
void |
free()
Free the underlying resources.
|
LockableRandomAccessBuffer |
getUnderlying() |
int |
hashCode()
Must reimplement hashCode() if we change equals().
|
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 |
realFree() |
long |
size() |
void |
storeTo(java.io.DataOutputStream dos)
Write enough data to reconstruct the Bucket, or throw UnsupportedOperationException.
|
boolean |
toFree() |
public DelayedFreeRandomAccessBuffer(LockableRandomAccessBuffer raf, PersistentFileTracker factory)
public DelayedFreeRandomAccessBuffer(java.io.DataInputStream dis,
FilenameGenerator fg,
PersistentFileTracker persistentFileTracker,
MasterSecret masterSecret)
throws java.io.IOException,
StorageFormatException,
ResumeFailedException
java.io.IOExceptionStorageFormatExceptionResumeFailedExceptionpublic long size()
size in interface RandomAccessBufferpublic 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 void close()
close in interface RandomAccessBufferclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic void free()
RandomAccessBufferfree in interface RandomAccessBufferpublic LockableRandomAccessBuffer.RAFLock lockOpen() throws java.io.IOException
LockableRandomAccessBufferlockOpen in interface LockableRandomAccessBufferjava.io.IOExceptionpublic void onResume(ClientContext context) throws ResumeFailedException
LockableRandomAccessBufferonResume in interface LockableRandomAccessBufferResumeFailedExceptionpublic void storeTo(java.io.DataOutputStream dos)
throws java.io.IOException
LockableRandomAccessBufferstoreTo in interface LockableRandomAccessBufferjava.io.IOExceptionpublic boolean toFree()
toFree in interface DelayedFreepublic LockableRandomAccessBuffer getUnderlying()
public void realFree()
realFree in interface DelayedFreepublic int hashCode()
LockableRandomAccessBufferhashCode in interface LockableRandomAccessBufferhashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in interface LockableRandomAccessBufferequals in class java.lang.Object