Package host.anzo.commons.utils
Class ZipUtils
java.lang.Object
host.anzo.commons.utils.ZipUtils
- Since:
- 10.03.2017
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]compress(byte[] data) static FileSystemcreateZipFileSystem(String zipFilename, boolean create) Returns a zip file systemstatic byte[]decompress(byte[] data) static voidputFileToZipStream(String fileName, ZipOutputStream zos) Add file to zip archive
-
Constructor Details
-
ZipUtils
public ZipUtils()
-
-
Method Details
-
createZipFileSystem
Returns a zip file system- Parameters:
zipFilename- to construct the file system fromcreate- true if the zip file should be created- Returns:
- a zip file system
- Throws:
IOException- if an I/O error occurs creating the file system
-
putFileToZipStream
Add file to zip archive- Parameters:
fileName- path to filezos- zip archive output stream
-
compress
public static byte[] compress(byte[] data) - Parameters:
data- bytes to compress- Returns:
- compressed bytes
-
decompress
public static byte[] decompress(byte[] data) - Parameters:
data- bytes to decompress- Returns:
- decompressed bytes
-