adams.core.io
Class LzfUtils

java.lang.Object
  extended by adams.core.io.LzfUtils

public class LzfUtils
extends Object

Helper class for LZF related operations.

Version:
$Revision: 5239 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Field Summary
static String EXTENSION
          the default extension.
 
Constructor Summary
LzfUtils()
           
 
Method Summary
static String compress(File inputFile, int buffer)
          Compresses the specified lzma archive to a file with the ".lzf" extension.
static String compress(File inputFile, int buffer, File outputFile)
          Compresses the specified lzma archive.
static String compress(File inputFile, int buffer, File outputFile, boolean removeInput)
          Compresses the specified lzma archive.
static String decompress(File archiveFile, int buffer)
          Decompresses the specified lzma archive to a file without the ".lzf" extension.
static String decompress(File archiveFile, int buffer, File outputFile)
          Decompresses the specified lzma archive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXTENSION

public static final String EXTENSION
the default extension.

See Also:
Constant Field Values
Constructor Detail

LzfUtils

public LzfUtils()
Method Detail

decompress

public static String decompress(File archiveFile,
                                int buffer)
Decompresses the specified lzma archive to a file without the ".lzf" extension.

Parameters:
archiveFile - the gzip file to decompress
buffer - the buffer size to use
Returns:
the error message, null if everything OK

decompress

public static String decompress(File archiveFile,
                                int buffer,
                                File outputFile)
Decompresses the specified lzma archive.

Parameters:
archiveFile - the lzma file to decompress
buffer - the buffer size to use
outputFile - the destination file
Returns:
the error message, null if everything OK

compress

public static String compress(File inputFile,
                              int buffer)
Compresses the specified lzma archive to a file with the ".lzf" extension.

Parameters:
inputFile - the file to compress
buffer - the buffer size to use
Returns:
the error message, null if everything OK

compress

public static String compress(File inputFile,
                              int buffer,
                              File outputFile)
Compresses the specified lzma archive. Does not remove the input file.

Parameters:
inputFile - the file to compress
buffer - the buffer size to use
outputFile - the destination file (the archive)
Returns:
the error message, null if everything OK

compress

public static String compress(File inputFile,
                              int buffer,
                              File outputFile,
                              boolean removeInput)
Compresses the specified lzma archive.

Parameters:
inputFile - the file to compress
buffer - the buffer size to use
outputFile - the destination file (the archive)
removeInput - whether to remove the input file
Returns:
the error message, null if everything OK


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.