org.schmant.task.at4j.bzip2
Class BZip2ExistingWritableFileProxy

java.lang.Object
  extended by org.schmant.task.at4j.bzip2.AbstractBZip2WritableFileProxy
      extended by org.schmant.task.at4j.bzip2.BZip2ExistingWritableFileProxy
All Implemented Interfaces:
Lockable, WriteLockable, WritableFile

public class BZip2ExistingWritableFileProxy
extends AbstractBZip2WritableFileProxy

This proxy bzip2 encodes data written to another, already existing WritableFile. It can be used together with the ArgumentInterpreter.

The difference between this object and the BZip2WritableFile is that this object uses the ArgumentInterpreter for interpreting the proxied file object.

The proxied object is interpreted using InterpretAsWritableFileStrategy.

Since:
0.8
Author:
Karl Gustafsson
See Also:
GZipExistingWritableFileProxy, LzmaExistingWritableFileProxy, BZip2NewWritableFileProxy, BZip2ReadableFileProxy
Task_package:
org.at4j

Constructor Summary
BZip2ExistingWritableFileProxy(Object proxied)
          Create a new bzip2 writable file proxy.
BZip2ExistingWritableFileProxy(Object proxied, BZip2WritableFileSettings settings)
          Create a new bzip2 writable file proxy.
BZip2ExistingWritableFileProxy(Object proxied, CompressionLevel level, boolean writeFileHeader)
          Deprecated. 
BZip2ExistingWritableFileProxy(Object proxied, int blockSize, boolean writeFileHeader)
          Deprecated. 
 
Method Summary
protected  WritableFile getFileFromArgumentInterpreter(Object proxied)
           
 
Methods inherited from class org.schmant.task.at4j.bzip2.AbstractBZip2WritableFileProxy
getFile, getWriteLock, isWriteLockedByCurrentThread, lockForWriting, openChannelForAppend, openChannelForWrite, openForAppend, openForWrite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BZip2ExistingWritableFileProxy

public BZip2ExistingWritableFileProxy(Object proxied)
Create a new bzip2 writable file proxy. The proxy will use the default bzip2 block size (900kb) and write the bzip2 file header.

Parameters:
proxied - The proxied object. This will be interpreted into a existing writable file when the client writes to the proxy.

BZip2ExistingWritableFileProxy

public BZip2ExistingWritableFileProxy(Object proxied,
                                      BZip2WritableFileSettings settings)
Create a new bzip2 writable file proxy. The proxy will use the bzip2 settings from the supplied settings object.

Parameters:
proxied - The proxied object. This will be interpreted into a existing writable file when the client writes to the proxy.
settings - The bzip2 settings. The settings object is cloned by the created proxy.
Since:
1.0.1

BZip2ExistingWritableFileProxy

@Deprecated
public BZip2ExistingWritableFileProxy(Object proxied,
                                                 int blockSize,
                                                 boolean writeFileHeader)
                               throws IllegalArgumentException
Deprecated. 

Create a new bzip2 writable file proxy for the proxied object. The proxy will use the supplied bzip2 block size.

Parameters:
proxied - The proxied object.
blockSize - The bzip2 block size, in 100kb increments.
writeFileHeader - Should the bzip2 file header ("BZ") be written to the file?
Throws:
IllegalArgumentException - If the block size is not between 1 and 9 (inclusive).

BZip2ExistingWritableFileProxy

@Deprecated
public BZip2ExistingWritableFileProxy(Object proxied,
                                                 CompressionLevel level,
                                                 boolean writeFileHeader)
Deprecated. 

Create a new bzip2 writable file proxy for the proxied object. The proxy will use the supplied compression level.

Parameters:
proxied - The proxied object.
level - The compression level.
writeFileHeader - Should the bzip2 file header ("BZ") be written to the file?
Since:
1.0
Method Detail

getFileFromArgumentInterpreter

protected WritableFile getFileFromArgumentInterpreter(Object proxied)
Specified by:
getFileFromArgumentInterpreter in class AbstractBZip2WritableFileProxy