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
IOException
public static byte[] compress(byte[] buffer) throws IOException
IOException
private static int writeHeader(BinaryWriter writer, int header) throws IOException
IOException
private static void writeEndOfDirectory(BinaryWriter writer, int count, int CDRSize, int CDROffset) throws IOException
IOException
private static int writeCentralDirectory(BinaryWriter writer, String fileName, int CRC, int compressedSize, int decompressedSize, int localHeaderOffset) throws IOException
IOException
private static void writeLocalFile(BinaryWriter writer, String fileName, int CRC, int decompressedSize, byte[] processedBuffer) throws IOException
IOException
private static boolean peekHeader(BinaryReader reader, int expecting) throws IOException
IOException
private static int readEndOfDirectory(BinaryReader reader) throws IOException
IOException
private static int readCentralDirectory(BinaryReader reader, Passable<String> fileName) throws IOException
IOException
private static byte[] readLocalFile(BinaryReader reader, Passable<String> fileName, Passable<Integer> decompressedSize) throws IOException
IOException
private static byte[] inflateBuffer(byte[] compressedBuffer, Passable<Integer> decompressedSize) throws IOException
IOException
private static byte[] deflateBuffer(byte[] uncompressedBuffer) throws IOException
IOException
Copyright © 2012. All Rights Reserved.