andrebrait commented on code in PR #345:
URL: https://github.com/apache/commons-compress/pull/345#discussion_r1059218171
##########
src/main/java/org/apache/commons/compress/archivers/zip/ZipUtil.java:
##########
@@ -30,10 +33,85 @@
* @Immutable
*/
public abstract class ZipUtil {
+
/**
+ * DOS time constant for representing timestamps before 1980.
* Smallest date/time ZIP can handle.
+ * <p>
+ * MS-DOS records file dates and times as packed 16-bit values. An MS-DOS
date has the following format.
+ * </p>
+ * <p>
+ * Bits Contents
+ * </p>
+ * <ul>
+ * <li>0-4: Day of the month (1-31).</li>
+ * <li>5-8: Month (1 = January, 2 = February, and so on).</li>
+ * <li>9-15: Year offset from 1980 (add 1980 to get the actual
year).</li>
+ * </ul>
+ *
+ * An MS-DOS time has the following format.
+ * <p>
+ * Bits Contents
+ * </p>
+ * <ul>
+ * <li>0-4: Second divided by 2.</li>
+ * <li>5-10: Minute (0-59).</li>
+ * <li>11-15: Hour (0-23 on a 24-hour clock).</li>
+ * </ul>
+ *
+ * This constant expresses the minimum DOS date of January 1st 1980 at
00:00:00 or, bit-by-bit:
+ * <ul>
+ * <li>Year: 0000000</li>
+ * <li>Month: 0001</li>
+ * <li>Day: 00001</li>
+ * <li>Hour: 00000</li>
+ * <li>Minute: 000000</li>
+ * <li>Seconds: 00000</li>
+ * </ul>
+ *
+ * <p>
+ * This was copied from {@link ZipEntry}.
+ * </p>
+ *
+ * @since 1.23
*/
- private static final byte[] DOS_TIME_MIN = ZipLong.getBytes(0x00002100L);
Review Comment:
@garydgregory note: this was previously the wrong value. We were lucky we
never stumbled upon this as a bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]