public class ZipFileHeader extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ZipFileHeader.Builder
Builder for
ZipFileHeader . |
Constructor and Description |
---|
ZipFileHeader(int versionNeeded,
int generalPurposeFlags,
int compressionMethod,
int lastModifiedTime,
int lastModifiedDate,
long crc32,
long compressedSize,
long uncompressedSize,
byte[] fileName,
byte[] extraFieldBytes,
Zip64ExtraField zip64ExtraField) |
Modifier and Type | Method and Description |
---|---|
static ZipFileHeader.Builder |
builder()
Make a builder for this class.
|
long |
getCompressedSize()
Zip64ExtraField in the getExtraFieldBytes() that has the real compressed size. |
int |
getCompressionLevel()
Read the compression level from the flags.
|
int |
getCompressionMethod() |
CompressionMethod |
getCompressionMethodAsEnum() |
long |
getCrc32() |
byte[] |
getExtraFieldBytes() |
String |
getFileName() |
byte[] |
getFileNameBytes() |
int |
getGeneralPurposeFlags() |
Set<GeneralPurposeFlag> |
getGeneralPurposeFlagsAsEnums() |
int |
getLastModifiedDate() |
String |
getLastModifiedDateString()
Return last modified date as a string in YYYY.mm.dd format.
|
java.time.LocalDateTime |
getLastModifiedDateTime()
Return last modified date and time as a
LocalDateTime . |
int |
getLastModifiedTime() |
String |
getLastModifiedTimeString()
Return last modified time as a string in 24-hour HH:MM:SS format.
|
long |
getUncompressedSize()
Get the 32-bit size of the uncompressed, original (unencoded) bytes.
|
int |
getVersionNeeded() |
int |
getVersionNeededMajorMinor()
Extract the version portion from the version-made information.
|
String |
getVersionNeededMajorMinorString()
Return the version needed in the from "#.#".
|
long |
getZip64CompressedSize()
Get the size of the compressed (encoded) bytes as encoded in the
Zip64ExtraField which should be in the
extraFieldBytes . |
Zip64ExtraField |
getZip64ExtraField()
Returns the Zip64 extra field in the extra-bytes or null if none.
|
long |
getZip64UncompressedSize()
Get the size of the uncompressed (unencoded) bytes as encoded in the
Zip64ExtraField which should be in
the extraFieldBytes . |
boolean |
hasFlag(GeneralPurposeFlag flag)
Return whether the header has this flag.
|
boolean |
needsDataDescriptor()
Does this file header need a data-descriptor.
|
static ZipFileHeader |
read(RewindableInputStream inputStream)
Read from the input stream.
|
String |
toString() |
void |
write(OutputStream outputStream)
Write to the input stream.
|
public ZipFileHeader(int versionNeeded, int generalPurposeFlags, int compressionMethod, int lastModifiedTime, int lastModifiedDate, long crc32, long compressedSize, long uncompressedSize, byte[] fileName, byte[] extraFieldBytes, Zip64ExtraField zip64ExtraField)
public static ZipFileHeader.Builder builder()
public static ZipFileHeader read(RewindableInputStream inputStream) throws IOException
IOException
public void write(OutputStream outputStream) throws IOException
IOException
public boolean hasFlag(GeneralPurposeFlag flag)
public int getVersionNeeded()
public int getVersionNeededMajorMinor()
public String getVersionNeededMajorMinorString()
public int getGeneralPurposeFlags()
public Set<GeneralPurposeFlag> getGeneralPurposeFlagsAsEnums()
public int getCompressionLevel()
public int getCompressionMethod()
public CompressionMethod getCompressionMethodAsEnum()
public int getLastModifiedTime()
public String getLastModifiedTimeString()
public int getLastModifiedDate()
public String getLastModifiedDateString()
public java.time.LocalDateTime getLastModifiedDateTime()
LocalDateTime
.public long getCrc32()
public long getCompressedSize()
Zip64ExtraField
in the getExtraFieldBytes()
that has the real compressed size. See
getZip64CompressedSize()
.public long getZip64CompressedSize()
Zip64ExtraField
which should be in the
extraFieldBytes
. If there is no extra field then the value of the getCompressedSize()
is
returned.public long getUncompressedSize()
Zip64ExtraField
in the getExtraFieldBytes()
that has the real compressed size. See
getZip64UncompressedSize()
.public long getZip64UncompressedSize()
Zip64ExtraField
which should be in
the extraFieldBytes
. If there is no extra field then the value of the getUncompressedSize()
is
returned.public byte[] getFileNameBytes()
public String getFileName()
public byte[] getExtraFieldBytes()
public Zip64ExtraField getZip64ExtraField()
public boolean needsDataDescriptor()
This documentation content is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.