本文整理了Java中org.apache.commons.compress.archivers.zip.ZipShort.<init>()
方法的一些代码示例,展示了ZipShort.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipShort.<init>()
方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipShort
类名称:ZipShort
方法名:<init>
[英]Create instance from a number.
[中]从一个数字创建一个实例。
代码示例来源:origin: org.apache.commons/commons-compress
@Override
public ZipShort getCentralDirectoryLength() {
return new ZipShort((size != null ? DWORD : 0)
+ (compressedSize != null ? DWORD : 0)
+ (relativeHeaderOffset != null ? DWORD : 0)
+ (diskStart != null ? WORD : 0));
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Length of the complete extra field in the local file data.
*
* @return The LocalFileDataLength value
*/
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(localFileData == null ? 0 : localFileData.length);
}
代码示例来源:origin: org.apache.commons/commons-compress
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(BASE_SIZE + padding);
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Get the length of the local data.
*
* @return the length of the local data
*/
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(localData != null ? localData.length : 0);
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Get the length of the local data.
* @return the length of the local data
*/
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(localData != null ? localData.length : 0);
}
代码示例来源:origin: org.apache.commons/commons-compress
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(size != null ? 2 * DWORD : 0);
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Length of the extra field in the local file data - without
* Header-ID or length specifier.
*
* @return a <code>ZipShort</code> for the length of the data of this extra field
*/
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(4 /* reserved */
+ 2 /* Tag#1 */
+ 2 /* Size#1 */
+ 3 * 8 /* time values */);
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Length of the extra field in the local file data - without
* Header-ID or length specifier.
*
* @return a <code>ZipShort</code> for the length of the data of this extra field
*/
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(1 +
(bit0_modifyTimePresent ? 4 : 0) +
(bit1_accessTimePresent && accessTime != null ? 4 : 0) +
(bit2_createTimePresent && createTime != null ? 4 : 0)
);
}
代码示例来源:origin: org.apache.commons/commons-compress
@Override
public ZipShort getCentralDirectoryLength() {
return new ZipShort(BASE_SIZE);
}
代码示例来源:origin: org.apache.commons/commons-compress
public X0016_CertificateIdForCentralDirectory() {
super(new ZipShort(0x0016));
}
代码示例来源:origin: org.apache.commons/commons-compress
public X0017_StrongEncryptionHeader() {
super(new ZipShort(0x0017));
}
代码示例来源:origin: org.apache.commons/commons-compress
public X0014_X509Certificates() {
super(new ZipShort(0x0014));
}
代码示例来源:origin: org.apache.commons/commons-compress
public X0019_EncryptionRecipientCertificateList() {
super(new ZipShort(0x0019));
}
代码示例来源:origin: org.apache.commons/commons-compress
public X0015_CertificateIdForFile() {
super(new ZipShort(0x0015));
}
代码示例来源:origin: org.apache.commons/commons-compress
@Override
public ZipShort getCentralDirectoryLength() {
if (data == null) {
assembleData();
}
return new ZipShort(data != null ? data.length : 0);
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Get the central data length.
* If there is no central data, get the local file data length.
* @return the central data length
*/
@Override
public ZipShort getCentralDirectoryLength() {
if (centralData != null) {
return new ZipShort(centralData.length);
}
return getLocalFileDataLength();
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Length of the complete extra field in the central directory.
*
* @return The CentralDirectoryLength value
*/
@Override
public ZipShort getCentralDirectoryLength() {
return centralDirectoryData == null
? getLocalFileDataLength()
: new ZipShort(centralDirectoryData.length);
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Get the central data length. If there is no central data, get the local
* file data length.
*
* @return the central data length
*/
@Override
public ZipShort getCentralDirectoryLength() {
if (centralData != null) {
return new ZipShort(centralData.length);
}
return getLocalFileDataLength();
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Length of the extra field in the local file data - without
* Header-ID or length specifier.
* @return a <code>ZipShort</code> for the length of the data of this extra field
*/
@Override
public ZipShort getLocalFileDataLength() {
return new ZipShort(WORD // CRC
+ 2 // Mode
+ WORD // SizDev
+ 2 // UID
+ 2 // GID
+ getLinkedFile().getBytes().length);
// Uses default charset - see class Javadoc
}
代码示例来源:origin: org.apache.commons/commons-compress
private void readTimeAttr(final byte[] data, int offset, final int length) {
if (length >= 2 + 3 * 8) {
final ZipShort tagValueLength = new ZipShort(data, offset);
if (TIME_ATTR_SIZE.equals(tagValueLength)) {
offset += 2;
modifyTime = new ZipEightByteInteger(data, offset);
offset += 8;
accessTime = new ZipEightByteInteger(data, offset);
offset += 8;
createTime = new ZipEightByteInteger(data, offset);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!