public class PaddedBucket extends java.lang.Object implements Bucket, java.io.Serializable
Modifier | Constructor and Description |
---|---|
protected |
PaddedBucket() |
|
PaddedBucket(Bucket underlying)
Create a PaddedBucket, assumed to be empty
|
|
PaddedBucket(Bucket underlying,
long size)
Create a PaddedBucket, specifying the actual size of the existing bucket, which we
do not store on disk.
|
protected |
PaddedBucket(java.io.DataInputStream dis,
FilenameGenerator fg,
PersistentFileTracker persistentFileTracker,
MasterSecret masterKey) |
Modifier and Type | Method and Description |
---|---|
Bucket |
createShadow()
Create a shallow read-only copy of this bucket, using different
objects but using the same external storage.
|
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.
|
boolean |
isReadOnly()
Is the bucket read-only?
|
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.
|
public PaddedBucket(Bucket underlying)
public PaddedBucket(Bucket underlying, long size)
underlying
- The underlying bucket.size
- The actual size of the data.protected PaddedBucket()
protected PaddedBucket(java.io.DataInputStream dis, FilenameGenerator fg, PersistentFileTracker persistentFileTracker, MasterSecret masterKey) throws java.io.IOException, StorageFormatException, ResumeFailedException
java.io.IOException
StorageFormatException
ResumeFailedException
public java.io.OutputStream getOutputStream() throws java.io.IOException
Bucket
getOutputStream
in interface Bucket
java.io.IOException
public java.io.OutputStream getOutputStreamUnbuffered() throws java.io.IOException
Bucket
getOutputStreamUnbuffered
in interface Bucket
java.io.IOException
public java.io.InputStream getInputStream() throws java.io.IOException
Bucket
getInputStream
in interface Bucket
java.io.IOException
public java.io.InputStream getInputStreamUnbuffered() throws java.io.IOException
getInputStreamUnbuffered
in interface Bucket
java.io.IOException
public java.lang.String getName()
Bucket
public long size()
Bucket
public boolean isReadOnly()
Bucket
isReadOnly
in interface Bucket
public void setReadOnly()
Bucket
setReadOnly
in interface Bucket
public void free()
Bucket
public Bucket createShadow()
Bucket
createShadow
in interface Bucket
public void onResume(ClientContext context) throws ResumeFailedException
Bucket
onResume
in interface Bucket
context
- All the necessary runtime support will be on this object.ResumeFailedException
public void storeTo(java.io.DataOutputStream dos) throws java.io.IOException
Bucket