System.arraycopy(data, offset + ivSize + 22 + erdSize + vSize - 4, vCRC32, 0, 4); } else { this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + ivSize + 20 + erdSize)); this.hashSize = ZipShort.getValue(data, offset + ivSize + 22 + erdSize); final int resize = ZipShort.getValue(data, offset + ivSize + 24 + erdSize);
System.arraycopy(data, offset + ivSize + 22 + erdSize + vSize - 4, vCRC32, 0, 4); } else { this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + ivSize + 20 + erdSize)); this.hashSize = ZipShort.getValue(data, offset + ivSize + 22 + erdSize); final int resize = ZipShort.getValue(data, offset + ivSize + 24 + erdSize);
/** * Parse central directory format. * * @param data the buffer to read data from * @param offset offset into buffer to read data * @param length the length of data */ public void parseCentralDirectoryFormat(final byte[] data, final int offset, final int length) { this.format = ZipShort.getValue(data, offset); this.algId = EncryptionAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 2)); this.bitlen = ZipShort.getValue(data, offset + 4); this.flags = ZipShort.getValue(data, offset + 6); this.rcount = ZipLong.getValue(data, offset + 8); if (rcount > 0) { this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 12)); this.hashSize = ZipShort.getValue(data, offset + 14); // srlist... hashed public keys for (long i = 0; i < this.rcount; i++) { for (int j = 0; j < this.hashSize; j++) { // ZipUtil.signedByteToUnsignedInt(data[offset + 16 + (i * this.hashSize) + j])); } } } }
@Override public void parseFromCentralDirectoryData(final byte[] data, final int offset, final int length) { this.rcount = ZipShort.getValue(data, offset); this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 2)); } }
@Override public void parseFromCentralDirectoryData(final byte[] data, final int offset, final int length) { super.parseFromCentralDirectoryData(data, offset, length); this.rcount = ZipShort.getValue(data, offset); this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 2)); } }
/** * Parse central directory format. * * @param data the buffer to read data from * @param offset offset into buffer to read data * @param length the length of data */ public void parseCentralDirectoryFormat(final byte[] data, final int offset, final int length) { this.format = ZipShort.getValue(data, offset); this.algId = EncryptionAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 2)); this.bitlen = ZipShort.getValue(data, offset + 4); this.flags = ZipShort.getValue(data, offset + 6); this.rcount = ZipLong.getValue(data, offset + 8); if (rcount > 0) { this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 12)); this.hashSize = ZipShort.getValue(data, offset + 14); // srlist... hashed public keys for (long i = 0; i < this.rcount; i++) { for (int j = 0; j < this.hashSize; j++) { // ZipUtil.signedByteToUnsignedInt(data[offset + 16 + (i * this.hashSize) + j])); } } } }
@Override public void parseFromCentralDirectoryData(final byte[] data, final int offset, final int length) { this.rcount = ZipShort.getValue(data, offset); this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 2)); } }
@Override public void parseFromCentralDirectoryData(final byte[] data, final int offset, final int length) { super.parseFromCentralDirectoryData(data, offset, length); this.rcount = ZipShort.getValue(data, offset); this.hashAlg = HashAlgorithm.getAlgorithmByCode(ZipShort.getValue(data, offset + 2)); } }