|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.compress.archivers.zip.ZipUtil
public abstract class ZipUtil
Utility class for handling DOS and Java time conversions.
| Constructor Summary | |
|---|---|
ZipUtil()
|
|
| Method Summary | |
|---|---|
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 byte[] |
reverse(byte[] array)
Reverses a byte[] array. |
static int |
signedByteToUnsignedInt(byte b)
Converts a signed byte into an unsigned integer representation (e.g., -1 becomes 255). |
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 byte |
unsignedIntToSignedByte(int i)
Converts an unsigned integer to a signed byte (e.g., 255 becomes -1). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ZipUtil()
| Method Detail |
|---|
public static ZipLong toDosTime(Date time)
time - the Date to convert
ZipLongpublic static byte[] toDosTime(long t)
Stolen from InfoZip's fileio.c
t - number of milliseconds since the epoch
public static long adjustToLong(int i)
i - the value to treat as unsigned int.
public static byte[] reverse(byte[] array)
array - to reverse (mutated in-place, but also returned for
convenience).
public static int signedByteToUnsignedInt(byte b)
b - byte to convert to int
public static byte unsignedIntToSignedByte(int i)
i - integer to convert to byte
IllegalArgumentException - if the provided integer is not inside the range [0,255].public static Date fromDosTime(ZipLong zipDosTime)
zipDosTime - contains the stored DOS time.
public static long dosToJavaTime(long dosTime)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||