public class ZipUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
CentralDirectoryHeader |
private static short |
DeflateCompression |
private static int |
EndOfDirectoryHeader |
private static int |
LocalFileHeader |
private static short |
Version |
| Constructor and Description |
|---|
ZipUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
compress(byte[] buffer) |
static byte[] |
deCompress(byte[] buffer) |
private static byte[] |
deflateBuffer(byte[] uncompressedBuffer) |
private static byte[] |
inflateBuffer(byte[] compressedBuffer,
Passable<Integer> decompressedSize) |
private static boolean |
peekHeader(BinaryReader reader,
int expecting) |
private static int |
readCentralDirectory(BinaryReader reader,
Passable<String> fileName) |
private static int |
readEndOfDirectory(BinaryReader reader) |
private static byte[] |
readLocalFile(BinaryReader reader,
Passable<String> fileName,
Passable<Integer> decompressedSize) |
private static int |
writeCentralDirectory(BinaryWriter writer,
String fileName,
int CRC,
int compressedSize,
int decompressedSize,
int localHeaderOffset) |
private static void |
writeEndOfDirectory(BinaryWriter writer,
int count,
int CDRSize,
int CDROffset) |
private static int |
writeHeader(BinaryWriter writer,
int header) |
private static void |
writeLocalFile(BinaryWriter writer,
String fileName,
int CRC,
int decompressedSize,
byte[] processedBuffer) |
private static int LocalFileHeader
private static int CentralDirectoryHeader
private static int EndOfDirectoryHeader
private static short DeflateCompression
private static short Version
public static byte[] deCompress(byte[] buffer)
throws IOException
IOExceptionpublic static byte[] compress(byte[] buffer)
throws IOException
IOExceptionprivate static int writeHeader(BinaryWriter writer, int header) throws IOException
IOExceptionprivate static void writeEndOfDirectory(BinaryWriter writer, int count, int CDRSize, int CDROffset) throws IOException
IOExceptionprivate static int writeCentralDirectory(BinaryWriter writer, String fileName, int CRC, int compressedSize, int decompressedSize, int localHeaderOffset) throws IOException
IOExceptionprivate static void writeLocalFile(BinaryWriter writer, String fileName, int CRC, int decompressedSize, byte[] processedBuffer) throws IOException
IOExceptionprivate static boolean peekHeader(BinaryReader reader, int expecting) throws IOException
IOExceptionprivate static int readEndOfDirectory(BinaryReader reader) throws IOException
IOExceptionprivate static int readCentralDirectory(BinaryReader reader, Passable<String> fileName) throws IOException
IOExceptionprivate static byte[] readLocalFile(BinaryReader reader, Passable<String> fileName, Passable<Integer> decompressedSize) throws IOException
IOExceptionprivate static byte[] inflateBuffer(byte[] compressedBuffer,
Passable<Integer> decompressedSize)
throws IOException
IOExceptionprivate static byte[] deflateBuffer(byte[] uncompressedBuffer)
throws IOException
IOExceptionCopyright © 2012. All Rights Reserved.