public class ReadOnlyFileSliceBucket extends java.lang.Object implements Bucket, java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ReadOnlyFileSliceBucket.ReadOnlyFileSliceBucketException |
Modifier | Constructor and Description |
---|---|
protected |
ReadOnlyFileSliceBucket(java.io.DataInputStream dis) |
|
ReadOnlyFileSliceBucket(java.io.File f,
long startAt,
long length) |
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 ReadOnlyFileSliceBucket(java.io.File f, long startAt, long length)
protected ReadOnlyFileSliceBucket(java.io.DataInputStream dis) throws StorageFormatException, java.io.IOException
StorageFormatException
java.io.IOException
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)
Bucket
public void storeTo(java.io.DataOutputStream dos) throws java.io.IOException
Bucket