public class ZipUtil extends Object
ZipFileEntrys from byte arrays.| Modifier and Type | Field and Description |
|---|---|
static long |
DOS_EPOCH
Midnight Jan 1st 1980.
|
static long |
MAX_DOS_DATE
23:59:59 Dec 31st 2107.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
arrayStartsWith(byte[] array,
byte[] target) |
static long |
dosToUnixTime(int timestamp)
Converts a 32-bit DOS timestamp into a unix timestamp.
|
static short |
get16(byte[] source,
int offset) |
static int |
get32(byte[] source,
int offset) |
static long |
get64(byte[] source,
int offset) |
static long |
getUnsignedInt(byte[] source,
int offset) |
static long |
getUnsignedLong(byte[] source,
int offset) |
static int |
getUnsignedShort(byte[] source,
int offset) |
static byte[] |
intToLittleEndian(byte[] buf,
int offset,
int value) |
static byte[] |
intToLittleEndian(int value) |
static boolean |
isValidInDos(long timeMillis)
Checks if the unix timestamp is representable as a valid DOS timestamp.
|
static byte[] |
longToLittleEndian(byte[] buf,
int offset,
long value) |
static byte[] |
longToLittleEndian(long value) |
static byte[] |
shortToLittleEndian(byte[] buf,
int offset,
short value) |
static byte[] |
shortToLittleEndian(short value) |
public static final long DOS_EPOCH
public static final long MAX_DOS_DATE
public static byte[] shortToLittleEndian(short value)
public static byte[] shortToLittleEndian(byte[] buf,
int offset,
short value)
public static byte[] intToLittleEndian(int value)
public static byte[] intToLittleEndian(byte[] buf,
int offset,
int value)
public static byte[] longToLittleEndian(long value)
public static byte[] longToLittleEndian(byte[] buf,
int offset,
long value)
public static short get16(byte[] source,
int offset)
public static int get32(byte[] source,
int offset)
public static long get64(byte[] source,
int offset)
public static int getUnsignedShort(byte[] source,
int offset)
public static long getUnsignedInt(byte[] source,
int offset)
public static long getUnsignedLong(byte[] source,
int offset)
throws ZipException
ZipExceptionpublic static boolean isValidInDos(long timeMillis)
See ZIP Format for a general description of the date a time fields (Section 4.4.6) and DOS date format for a detailed description of the format.
public static long dosToUnixTime(int timestamp)
public static boolean arrayStartsWith(byte[] array,
byte[] target)
Copyright © 2012–2022. All rights reserved.