/** * Sets the compression method for this entry. * * @see #getMethod() * @see ZipOutputStream#setMethod(int) * @throws IllegalArgumentException If {@code method} is not * {@link #STORED}, {@link #DEFLATED}, {@link #BZIP2} or * {@link #UNKNOWN}. */ public final void setMethod(final int method) { switch (method) { case WINZIP_AES: // This is only present to support manual copying of properties. // It should never be set by applications. case STORED: case DEFLATED: case BZIP2: this.method = (short) method; setInit(METHOD, true); break; case UNKNOWN: this.method = 0; setInit(METHOD, false); break; default: throw new IllegalArgumentException( name + " (unsupported compression method " + method + ")"); } }
final void setRawTime(final long dtime) { assert UInt.check(dtime); this.dtime = (int) dtime; setInit(DTIME, true); }
public final void setCrc(final long crc) { final boolean known = UNKNOWN != crc; if (known) { UInt.check(crc, name, "CRC-32 out of range"); this.crc = (int) crc; } else { this.crc = 0; } setInit(CRC, known); }
final void setRawExternalAttributes(final long eattr) { assert UInt.check(eattr); this.eattr = (int) eattr; setInit(EATTR, true); }
final void setRawPlatform(final int platform) { assert UByte.check(platform); this.platform = (byte) platform; setInit(PLATFORM, true); }
final void setRawCrc(final long crc) { assert UInt.check(crc); this.crc = (int) crc; setInit(CRC, true); }
public final void setPlatform(final short platform) { final boolean known = UNKNOWN != platform; if (known) { UByte.check(platform, name, "Platform out of range"); this.platform = (byte) platform; } else { this.platform = 0; } setInit(PLATFORM, known); }
final void setRawMethod(final int method) { assert UShort.check(method); this.method = (short) method; setInit(METHOD, true); }
/** * Sets the external file attributes. * * @param eattr the external file attributes. * @since TrueZIP 7.3 */ public final void setExternalAttributes(final long eattr) { final boolean known = UNKNOWN != eattr; if (known) { UInt.check(eattr, name, "external file attributes out of range"); this.eattr = (int) eattr; } else { this.eattr = 0; } setInit(EATTR, known); }
public final void setTime(final long jtime) { final boolean known = UNKNOWN != jtime; if (known) { this.dtime = (int) getDateTimeConverter().toDosTime(jtime); } else { this.dtime = 0; } setInit(DTIME, known); }