public class TempBucketFactory.TempBucket extends java.lang.Object implements Bucket, RandomAccessBucket
| Modifier and Type | Field and Description |
|---|---|
long |
creationTime
A timestamp used to evaluate the age of the bucket and maybe consider it for a migration
|
| Constructor and Description |
|---|
TempBucket(long now,
RandomAccessBucket cur) |
| Modifier and Type | Method and Description |
|---|---|
RandomAccessBucket |
createShadow()
Create a shallow read-only copy of this bucket, using different
objects but using the same external storage.
|
long |
creationTime() |
protected void |
finalize() |
void |
free()
Free the bucket, if supported.
|
java.io.InputStream |
getInputStream()
Returns an InputStream that reads data from this Bucket.
|
java.io.InputStream |
getInputStreamUnbuffered() |
java.lang.String |
getName()
Returns a name for the bucket, may be used to identify them in
certain in certain situations.
|
java.io.OutputStream |
getOutputStream()
Returns an OutputStream that is used to put data in this Bucket, from the
beginning.
|
java.io.OutputStream |
getOutputStreamUnbuffered()
Get an OutputStream which is not buffered.
|
java.lang.ref.WeakReference<freenet.support.io.TempBucketFactory.Migratable> |
getReference() |
boolean |
isRAMBucket() |
boolean |
isReadOnly()
Is the bucket read-only?
|
boolean |
migrateToDisk()
A blocking method to force-migrate from a RAMBucket to a FileBucket
|
void |
onResume(ClientContext context)
Called after restarting.
|
void |
setReadOnly()
Make the bucket read-only.
|
long |
size()
Returns the amount of data currently in this bucket in bytes.
|
void |
storeTo(java.io.DataOutputStream dos)
Write enough data to reconstruct the Bucket, or throw UnsupportedOperationException.
|
LockableRandomAccessBuffer |
toRandomAccessBuffer()
Convert the Bucket to a LockableRandomAccessBuffer.
|
public final long creationTime
public TempBucket(long now,
RandomAccessBucket cur)
public final boolean migrateToDisk()
throws java.io.IOException
java.io.IOExceptionpublic final boolean isRAMBucket()
public java.io.OutputStream getOutputStream()
throws java.io.IOException
BucketgetOutputStream in interface Bucketjava.io.IOExceptionpublic java.io.OutputStream getOutputStreamUnbuffered()
throws java.io.IOException
BucketgetOutputStreamUnbuffered in interface Bucketjava.io.IOExceptionpublic java.io.InputStream getInputStream()
throws java.io.IOException
BucketgetInputStream in interface Bucketjava.io.IOExceptionpublic java.io.InputStream getInputStreamUnbuffered()
throws java.io.IOException
getInputStreamUnbuffered in interface Bucketjava.io.IOExceptionpublic java.lang.String getName()
Bucketpublic long size()
Bucketpublic boolean isReadOnly()
BucketisReadOnly in interface Bucketpublic void setReadOnly()
BucketsetReadOnly in interface Bucketpublic void free()
Bucketpublic RandomAccessBucket createShadow()
BucketcreateShadow in interface BucketcreateShadow in interface RandomAccessBucketpublic java.lang.ref.WeakReference<freenet.support.io.TempBucketFactory.Migratable> getReference()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic long creationTime()
public void onResume(ClientContext context)
Bucketpublic void storeTo(java.io.DataOutputStream dos)
throws java.io.IOException
Bucketpublic LockableRandomAccessBuffer toRandomAccessBuffer() throws java.io.IOException
RandomAccessBuckettoRandomAccessBuffer in interface RandomAccessBucketjava.io.IOException