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
StorageFormatExceptionjava.io.IOExceptionpublic 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 Bucket createShadow()
BucketcreateShadow in interface Bucketpublic void onResume(ClientContext context)
Bucketpublic void storeTo(java.io.DataOutputStream dos)
throws java.io.IOException
Bucket