Java Code Examples for net.lingala.zip4j.model.enums.CompressionMethod#DEFLATE
The following examples show how to use
net.lingala.zip4j.model.enums.CompressionMethod#DEFLATE .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZipVersionUtils.java From zip4j with Apache License 2.0 | 6 votes |
public static VersionNeededToExtract determineVersionNeededToExtract(ZipParameters zipParameters) { VersionNeededToExtract versionRequired = VersionNeededToExtract.DEFAULT; if (zipParameters.getCompressionMethod() == CompressionMethod.DEFLATE) { versionRequired = VersionNeededToExtract.DEFLATE_COMPRESSED; } if (zipParameters.getEntrySize() > InternalZipConstants.ZIP_64_SIZE_LIMIT) { versionRequired = VersionNeededToExtract.ZIP_64_FORMAT; } if (zipParameters.isEncryptFiles() && zipParameters.getEncryptionMethod().equals(EncryptionMethod.AES)) { versionRequired = VersionNeededToExtract.AES_ENCRYPTED; } return versionRequired; }
Example 2
Source File: AESExtraDataRecord.java From zip4j with Apache License 2.0 | 5 votes |
public AESExtraDataRecord() { setSignature(HeaderSignature.AES_EXTRA_DATA_RECORD); dataSize = 7; aesVersion = AesVersion.TWO; vendorID = "AE"; aesKeyStrength = AesKeyStrength.KEY_STRENGTH_256; compressionMethod = CompressionMethod.DEFLATE; }
Example 3
Source File: ZipInputStream.java From zip4j with Apache License 2.0 | 5 votes |
private DecompressedInputStream initializeDecompressorForThisEntry(CipherInputStream cipherInputStream, LocalFileHeader localFileHeader) { CompressionMethod compressionMethod = getCompressionMethod(localFileHeader); if (compressionMethod == CompressionMethod.DEFLATE) { return new InflaterInputStream(cipherInputStream); } return new StoreInputStream(cipherInputStream); }
Example 4
Source File: CipherInputStream.java From zip4j with Apache License 2.0 | 5 votes |
public CipherInputStream(ZipEntryInputStream zipEntryInputStream, LocalFileHeader localFileHeader, char[] password) throws IOException, ZipException { this.zipEntryInputStream = zipEntryInputStream; this.decrypter = initializeDecrypter(localFileHeader, password); this.localFileHeader = localFileHeader; if (getCompressionMethod(localFileHeader) == CompressionMethod.DEFLATE) { lastReadRawDataCache = new byte[InternalZipConstants.BUFF_SIZE]; } }
Example 5
Source File: ZipOutputStream.java From zip4j with Apache License 2.0 | 5 votes |
private CompressedOutputStream initializeCompressedOutputStream(CipherOutputStream cipherOutputStream, ZipParameters zipParameters) { if (zipParameters.getCompressionMethod() == CompressionMethod.DEFLATE) { return new DeflaterOutputStream(cipherOutputStream, zipParameters.getCompressionLevel()); } return new StoreOutputStream(cipherOutputStream); }
Example 6
Source File: FileHeaderFactoryTest.java From zip4j with Apache License 2.0 | 5 votes |
private void verifyGeneralPurposeBytes(byte[] generalPurposeBytes, ZipParameters zipParameters) { assertThat(generalPurposeBytes).isNotNull(); assertThat(generalPurposeBytes.length).isEqualTo(2); assertThat(isBitSet(generalPurposeBytes[0], 0)).isEqualTo(zipParameters.isEncryptFiles()); if (zipParameters.getCompressionMethod() == CompressionMethod.DEFLATE) { verifyCompressionLevelGridForDeflate(zipParameters.getCompressionLevel(), generalPurposeBytes[0]); } else { assertThat(isBitSet(generalPurposeBytes[0], 1)).isFalse(); assertThat(isBitSet(generalPurposeBytes[0], 2)).isFalse(); } assertThat(isBitSet(generalPurposeBytes[0], 3)).isEqualTo(zipParameters.isWriteExtendedLocalFileHeader()); assertThat(isBitSet(generalPurposeBytes[1], 3)).isTrue(); }