public class BZip2ReadableFile extends Object implements org.entityfs.ReadableFile
ReadableFile
that transparently decompresses the contents
of a wrapped file using bzip2.
bzip2 input streams are opened on buffered input streams on the underlying file. The buffer size can be configured.
A ReadableFile
can be made into a
NamedReadableFile
using the
NamedReadableFileAdapter
.
BZip2WritableFile
,
LzmaReadableFile
,
GZipReadableFile
,
BZip2InputStream
Constructor and Description |
---|
BZip2ReadableFile(org.entityfs.ReadableFile adapted)
Create a new adapter.
|
BZip2ReadableFile(org.entityfs.ReadableFile adapted,
boolean assumeMagicBytes)
Deprecated.
The
assumeMagicBytes property is always true from
At4J 1.1. |
BZip2ReadableFile(org.entityfs.ReadableFile adapted,
boolean assumeMagicBytes,
int bufferSize)
Deprecated.
The
assumeMagicBytes property is always true from
At4J 1.1. |
BZip2ReadableFile(org.entityfs.ReadableFile adapted,
BZip2ReadableFileSettings settings)
Create a new adapter.
|
Modifier and Type | Method and Description |
---|---|
long |
getDataSize() |
org.entityfs.lock.EntityLock |
getReadLock() |
long |
getSize() |
boolean |
isReadLockedByCurrentThread() |
org.entityfs.lock.EntityLock |
lockForReading() |
ReadableByteChannel |
openChannelForRead() |
InputStream |
openForRead() |
public BZip2ReadableFile(org.entityfs.ReadableFile adapted)
adapted
- The adapted file.BZip2ReadableFile(ReadableFile, BZip2ReadableFileSettings)
@Deprecated public BZip2ReadableFile(org.entityfs.ReadableFile adapted, boolean assumeMagicBytes)
assumeMagicBytes
property is always true from
At4J 1.1.adapted
- The adapted file.assumeMagicBytes
- Does the compressed data in the file start with
the two magic bytes "BZ"? Starting with At4J 1.1, this property must be
true
.@Deprecated public BZip2ReadableFile(org.entityfs.ReadableFile adapted, boolean assumeMagicBytes, int bufferSize)
assumeMagicBytes
property is always true from
At4J 1.1.adapted
- The adapted file.assumeMagicBytes
- Does the compressed data in the file start with
the two magic bytes "BZ"? Starting with At4J 1.1, this property must be
true
.bufferSize
- The size of the buffer for the buffered input stream
that the bzip2 input stream is opened on. Set this to -1
to use
the default buffer size (8192 bytes).public BZip2ReadableFile(org.entityfs.ReadableFile adapted, BZip2ReadableFileSettings settings)
adapted
- The adapted file.settings
- The settings for this readable file. A clone of the
settings object is stored in the created object.BZip2ReadableFile(ReadableFile)
public ReadableByteChannel openChannelForRead() throws org.entityfs.lock.ReadLockRequiredException, org.entityfs.security.AccessDeniedException
openChannelForRead
in interface org.entityfs.ReadableFile
org.entityfs.lock.ReadLockRequiredException
org.entityfs.security.AccessDeniedException
public InputStream openForRead() throws org.entityfs.lock.ReadLockRequiredException, org.entityfs.security.AccessDeniedException
openForRead
in interface org.entityfs.ReadableFile
org.entityfs.lock.ReadLockRequiredException
org.entityfs.security.AccessDeniedException
public org.entityfs.lock.EntityLock getReadLock()
getReadLock
in interface org.entityfs.lock.ReadLockable
public boolean isReadLockedByCurrentThread() throws IllegalStateException
isReadLockedByCurrentThread
in interface org.entityfs.lock.ReadLockable
IllegalStateException
public org.entityfs.lock.EntityLock lockForReading() throws org.entityfs.exception.LockTimeoutException
lockForReading
in interface org.entityfs.lock.ReadLockable
org.entityfs.exception.LockTimeoutException
public long getDataSize() throws org.entityfs.lock.ReadLockRequiredException, org.entityfs.security.AccessDeniedException
getDataSize
in interface org.entityfs.ReadableFile
org.entityfs.lock.ReadLockRequiredException
org.entityfs.security.AccessDeniedException
public long getSize() throws org.entityfs.lock.ReadLockRequiredException, org.entityfs.security.AccessDeniedException
getSize
in interface org.entityfs.ReadableFile
org.entityfs.lock.ReadLockRequiredException
org.entityfs.security.AccessDeniedException