public class LzmaWritableFile extends Object implements org.entityfs.WritableFile
WritableFile
that transparently compresses the data written
to a file using LZMA compression. The LZMA output stream is opened on a
buffered output stream on the file. The buffer size can be configured.
This file cannot be appended to. The openForAppend
methods throw an
UnsupportedOperationException
.
LzmaReadableFile
,
GZipWritableFile
,
BZip2WritableFile
Constructor and Description |
---|
LzmaWritableFile(org.entityfs.WritableFile adapted)
Create a new adapter using the default LZMA compression settings.
|
LzmaWritableFile(org.entityfs.WritableFile adapted,
LzmaOutputStreamSettings settings)
Create a new adapter using the supplied LZMA settings
|
Modifier and Type | Method and Description |
---|---|
org.entityfs.lock.EntityLock |
getWriteLock() |
boolean |
isWriteLockedByCurrentThread() |
org.entityfs.lock.EntityLock |
lockForWriting() |
WritableByteChannel |
openChannelForAppend()
This method always throws an
UnsupportedOperationException . |
WritableByteChannel |
openChannelForWrite() |
OutputStream |
openForAppend()
This method always throws an
UnsupportedOperationException . |
OutputStream |
openForWrite() |
public LzmaWritableFile(org.entityfs.WritableFile adapted)
BufferedOutputStream
's default buffer size.adapted
- The writable file to adapt.public LzmaWritableFile(org.entityfs.WritableFile adapted, LzmaOutputStreamSettings settings)
adapted
- The writable file to adapt.settings
- Compression configuration. Set this to null
to
use the default configuration.public WritableByteChannel openChannelForAppend() throws UnsupportedOperationException
UnsupportedOperationException
.openChannelForAppend
in interface org.entityfs.WritableFile
UnsupportedOperationException
- Always.public WritableByteChannel openChannelForWrite() throws org.entityfs.lock.WriteLockRequiredException, org.entityfs.security.AccessDeniedException, org.entityfs.exception.ReadOnlyException
openChannelForWrite
in interface org.entityfs.WritableFile
org.entityfs.lock.WriteLockRequiredException
org.entityfs.security.AccessDeniedException
org.entityfs.exception.ReadOnlyException
public OutputStream openForAppend() throws UnsupportedOperationException
UnsupportedOperationException
.openForAppend
in interface org.entityfs.WritableFile
UnsupportedOperationException
- Always.public OutputStream openForWrite() throws org.entityfs.lock.WriteLockRequiredException, org.entityfs.security.AccessDeniedException, org.entityfs.exception.ReadOnlyException
openForWrite
in interface org.entityfs.WritableFile
org.entityfs.lock.WriteLockRequiredException
org.entityfs.security.AccessDeniedException
org.entityfs.exception.ReadOnlyException
public org.entityfs.lock.EntityLock getWriteLock()
getWriteLock
in interface org.entityfs.lock.WriteLockable
public boolean isWriteLockedByCurrentThread()
isWriteLockedByCurrentThread
in interface org.entityfs.lock.WriteLockable
public org.entityfs.lock.EntityLock lockForWriting() throws org.entityfs.exception.LockTimeoutException
lockForWriting
in interface org.entityfs.lock.WriteLockable
org.entityfs.exception.LockTimeoutException