Class Lzf

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, Serializable, Comparable

    public class Lzf
    extends AbstractSingleCompress
    Creates a LZF archive from a single file. Outputs the filename of the LZF file generated. Optionally, the original input file can be deleted.

    More information see here:

    - accepts:
    - generates:

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to 
        the console (0 = off).
        default: 0
        minimum: 0
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: Lzf
    -annotation <adams.core.base.BaseText> (property: annotations)
        The annotations to attach to this actor.
    -skip (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded 
        as it is.
    -stop-flow-on-error (property: stopFlowOnError)
        If set to true, the flow gets stopped in case this actor encounters an error;
         useful for critical actors.
    -remove (property: removeInputFile)
        If set to true, then the original input file will be deleted after a successful 
    -output <> (property: output)
        The LZF file to create; if pointing to a directory, then the output filename 
        is based on the file that is being compressed and the '.lzf' extension added.
        default: ${CWD}
    -buffer <int> (property: bufferSize)
        The size of the buffer in bytes for the data stream.
        default: 1024
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • Lzf

        public Lzf()
    • Method Detail

      • outputTipText

        public String outputTipText()
        Returns the tip text for this property.
        Specified by:
        outputTipText in class AbstractSingleCompress
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultExtension

        protected String getDefaultExtension()
        Returns the default extension that the compressed archive has, e.g., ".lzf" for compressed files.
        Specified by:
        getDefaultExtension in class AbstractSingleCompress
        the extension, including the dot
      • compress

        protected String compress​(File inFile,
                                  File outFile)
        Compresses the file.
        Specified by:
        compress in class AbstractSingleCompress
        inFile - the uncompressed input file
        outFile - the compressed output file
        null if successfully compressed, otherwise error message
      • compress

        protected String compress​(byte[] inBytes,
                                  gnu.trove.list.TByteList outBytes)
        Compresses the bytes.
        Specified by:
        compress in class AbstractSingleCompress
        inBytes - the uncompressed bytes
        outBytes - the compressed bytes
        null if successfully compressed, otherwise error message