org.apache.commons.compress.archivers.zip.ZipUtil.dosToJavaTime()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(76)

本文整理了Java中org.apache.commons.compress.archivers.zip.ZipUtil.dosToJavaTime()方法的一些代码示例,展示了ZipUtil.dosToJavaTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipUtil.dosToJavaTime()方法的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.ZipUtil
类名称:ZipUtil
方法名:dosToJavaTime

ZipUtil.dosToJavaTime介绍

[英]Converts DOS time to Java time (number of milliseconds since epoch).
[中]将DOS时间转换为Java时间(从epoch开始的毫秒数)。

代码示例

代码示例来源:origin: org.apache.commons/commons-compress

/**
 * Convert a DOS date/time field to a Date object.
 *
 * @param zipDosTime contains the stored DOS time.
 * @return a Date instance corresponding to the given time.
 */
public static Date fromDosTime(final ZipLong zipDosTime) {
  final long dosTime = zipDosTime.getValue();
  return new Date(dosToJavaTime(dosTime));
}

代码示例来源:origin: org.apache.commons/commons-compress

/**
 * The last modified date of the entry.
 *
 * <p>Note the interpretation of time is different depending on
 * the HostOS that has created the archive.  While an OS that is
 * {@link #isHostOsUnix considered to be Unix} stores time in a
 * timezone independent manner, other platforms only use the local
 * time.  I.e. if an archive has been created at midnight UTC on a
 * machine in timezone UTC this method will return midnight
 * regardless of timezone if the archive has been created on a
 * non-Unix system and a time taking the current timezone into
 * account if the archive has beeen created on Unix.</p>
 *
 * @return the last modified date
 */
@Override
public Date getLastModifiedDate() {
  final long ts = isHostOsUnix() ? localFileHeader.dateTimeModified * 1000L
    : ZipUtil.dosToJavaTime(0xFFFFFFFFL & localFileHeader.dateTimeModified);
  return new Date(ts);
}

代码示例来源:origin: org.apache.commons/commons-compress

off += SHORT;
final long time = ZipUtil.dosToJavaTime(ZipLong.getValue(cfhBuf, off));
ze.setTime(time);
off += WORD;

代码示例来源:origin: org.apache.commons/commons-compress

off += SHORT;
final long time = ZipUtil.dosToJavaTime(ZipLong.getValue(lfhBuf, off));
current.entry.setTime(time);
off += WORD;

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Convert a DOS date/time field to a Date object.
 *
 * @param zipDosTime contains the stored DOS time.
 * @return a Date instance corresponding to the given time.
 */
public static Date fromDosTime(final ZipLong zipDosTime) {
  final long dosTime = zipDosTime.getValue();
  return new Date(dosToJavaTime(dosTime));
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * The last modified date of the entry.
 *
 * <p>Note the interpretation of time is different depending on
 * the HostOS that has created the archive.  While an OS that is
 * {@link #isHostOsUnix considered to be Unix} stores time in a
 * timezone independent manner, other platforms only use the local
 * time.  I.e. if an archive has been created at midnight UTC on a
 * machine in timezone UTC this method will return midnight
 * regardless of timezone if the archive has been created on a
 * non-Unix system and a time taking the current timezone into
 * account if the archive has beeen created on Unix.</p>
 *
 * @return the last modified date
 */
@Override
public Date getLastModifiedDate() {
  final long ts = isHostOsUnix() ? localFileHeader.dateTimeModified * 1000L
    : ZipUtil.dosToJavaTime(0xFFFFFFFFL & localFileHeader.dateTimeModified);
  return new Date(ts);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

off += SHORT;
final long time = ZipUtil.dosToJavaTime(ZipLong.getValue(cfhBuf, off));
ze.setTime(time);
off += WORD;

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

off += SHORT;
final long time = ZipUtil.dosToJavaTime(ZipLong.getValue(lfhBuf, off));
current.entry.setTime(time);
off += WORD;

相关文章