@Override public byte[] getCentralDirectoryData() { return ZipShort.getBytes(alignment | (allowMethodChange ? ALLOW_METHOD_MESSAGE_CHANGE_FLAG : 0)); }
/** * The actual data to put into local file data - without Header-ID * or length specifier. * * @return get the data */ @Override public byte[] getLocalFileDataData() { final byte[] data = new byte[getLocalFileDataLength().getValue()]; int pos = 4; System.arraycopy(TIME_ATTR_TAG.getBytes(), 0, data, pos, 2); pos += 2; System.arraycopy(TIME_ATTR_SIZE.getBytes(), 0, data, pos, 2); pos += 2; System.arraycopy(modifyTime.getBytes(), 0, data, pos, 8); pos += 8; System.arraycopy(accessTime.getBytes(), 0, data, pos, 8); pos += 8; System.arraycopy(createTime.getBytes(), 0, data, pos, 8); return data; }
/** * The actual data to put into local file data - without Header-ID * or length specifier. * @return get the data */ @Override public byte[] getLocalFileDataData() { // CRC will be added later final byte[] data = new byte[getLocalFileDataLength().getValue() - WORD]; System.arraycopy(ZipShort.getBytes(getMode()), 0, data, 0, 2); final byte[] linkArray = getLinkedFile().getBytes(); // Uses default charset - see class Javadoc // CheckStyle:MagicNumber OFF System.arraycopy(ZipLong.getBytes(linkArray.length), 0, data, 2, WORD); System.arraycopy(ZipShort.getBytes(getUserId()), 0, data, 6, 2); System.arraycopy(ZipShort.getBytes(getGroupId()), 0, data, 8, 2); System.arraycopy(linkArray, 0, data, 10, linkArray.length); // CheckStyle:MagicNumber ON crc.reset(); crc.update(data); final long checksum = crc.getValue(); final byte[] result = new byte[data.length + WORD]; System.arraycopy(ZipLong.getBytes(checksum), 0, result, 0, WORD); System.arraycopy(data, 0, result, WORD, data.length); return result; }
writeOut(ZipShort.getBytes(versionNeededToExtract(entry.entry.getMethod(), false, false)));
@Override public byte[] getCentralDirectoryData() { return ZipShort.getBytes(alignment | (allowMethodChange ? ALLOW_METHOD_MESSAGE_CHANGE_FLAG : 0)); }
/** * The actual data to put into local file data - without Header-ID * or length specifier. * * @return get the data */ @Override public byte[] getLocalFileDataData() { final byte[] data = new byte[getLocalFileDataLength().getValue()]; int pos = 4; System.arraycopy(TIME_ATTR_TAG.getBytes(), 0, data, pos, 2); pos += 2; System.arraycopy(TIME_ATTR_SIZE.getBytes(), 0, data, pos, 2); pos += 2; System.arraycopy(modifyTime.getBytes(), 0, data, pos, 8); pos += 8; System.arraycopy(accessTime.getBytes(), 0, data, pos, 8); pos += 8; System.arraycopy(createTime.getBytes(), 0, data, pos, 8); return data; }
/** * The actual data to put into local file data - without Header-ID * or length specifier. * @return get the data */ @Override public byte[] getLocalFileDataData() { // CRC will be added later final byte[] data = new byte[getLocalFileDataLength().getValue() - WORD]; System.arraycopy(ZipShort.getBytes(getMode()), 0, data, 0, 2); final byte[] linkArray = getLinkedFile().getBytes(); // Uses default charset - see class Javadoc // CheckStyle:MagicNumber OFF System.arraycopy(ZipLong.getBytes(linkArray.length), 0, data, 2, WORD); System.arraycopy(ZipShort.getBytes(getUserId()), 0, data, 6, 2); System.arraycopy(ZipShort.getBytes(getGroupId()), 0, data, 8, 2); System.arraycopy(linkArray, 0, data, 10, linkArray.length); // CheckStyle:MagicNumber ON crc.reset(); crc.update(data); final long checksum = crc.getValue(); final byte[] result = new byte[data.length + WORD]; System.arraycopy(ZipLong.getBytes(checksum), 0, result, 0, WORD); System.arraycopy(data, 0, result, WORD, data.length); return result; }
writeOut(ZipShort.getBytes(versionNeededToExtract(entry.entry.getMethod(), false, false)));