public abstract class ZipUtil extends Object
Constructor and Description |
---|
ZipUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
adjustToLong(int i)
Assumes a negative integer really is a positive integer that
has wrapped around and re-creates the original value.
|
static long |
dosToJavaTime(long dosTime)
Converts DOS time to Java time (number of milliseconds since
epoch).
|
static Date |
fromDosTime(ZipLong zipDosTime)
Convert a DOS date/time field to a Date object.
|
static ZipLong |
toDosTime(Date time)
Convert a Date object to a DOS date/time field.
|
static byte[] |
toDosTime(long t)
Convert a Date object to a DOS date/time field.
|
static void |
toDosTime(long t,
byte[] buf,
int offset)
Convert a Date object to a DOS date/time field.
|
public static long adjustToLong(int i)
This methods is no longer used as of Apache Ant 1.9.0
i
- the value to treat as unsigned int.public static long dosToJavaTime(long dosTime)
public static Date fromDosTime(ZipLong zipDosTime)
zipDosTime
- contains the stored DOS time.public static ZipLong toDosTime(Date time)
time
- the Date
to convertZipLong
public static byte[] toDosTime(long t)
Stolen from InfoZip's fileio.c
t
- number of milliseconds since the epochpublic static void toDosTime(long t, byte[] buf, int offset)
Stolen from InfoZip's fileio.c
t
- number of milliseconds since the epochbuf
- the output bufferoffset
- The offset within the output buffer of the first byte to be written.
must be non-negative and no larger than buf.length-4