ResourceAlignmentExtraField

An extra field who's sole purpose is to align and pad the local file header so that the entry's data starts at a certain position.

The padding content of the padding is ignored and not retained when reading a padding field.

This enables Commons Compress to create "aligned" archives similar to Android's zipalign command line tool.

Since

1.14

See also

"https://developer.android.com/studio/command-line/zipalign.html"

Constructors

Link copied to clipboard
constructor()
constructor(alignment: Int)
constructor(alignment: Int, allowMethodChange: Boolean)
constructor(alignment: Int, allowMethodChange: Boolean, padding: Int)

Properties

Link copied to clipboard
open val alignment: Short
Link copied to clipboard
val BASE_SIZE: Int = 2
Link copied to clipboard
Size of an extra field field header (id + length).
Link copied to clipboard
Extra field id used for storing alignment and padding.

Functions

Link copied to clipboard
Indicates whether method change is allowed when re-compressing the ZIP file.
Link copied to clipboard
The actual data to put into central directory - without Header-ID or length specifier.
Link copied to clipboard
Length of the extra field in the central directory - without Header-ID or length specifier.
Link copied to clipboard
open fun getHeaderId(): ZipShort
The Header-ID.
Link copied to clipboard
The actual data to put into local file data - without Header-ID or length specifier.
Link copied to clipboard
Length of the extra field in the local file data - without Header-ID or length specifier.
Link copied to clipboard
open fun parseFromCentralDirectoryData(buffer: Array<Byte>, offset: Int, length: Int)
Populate data from this array as if it was in central directory data.
Link copied to clipboard
open fun parseFromLocalFileData(buffer: Array<Byte>, offset: Int, length: Int)
Populate data from this array as if it was in local file data.