The C structure for a sparse entry is:
struct posix_header {
struct sparse sp[21]; // TarConstants.SPARSELEN_GNU_SPARSE - offset 0
char isextended; // TarConstants.ISEXTENDEDLEN_GNU_SPARSE - offset 504
};
Whereas, "struct sparse" is:
struct sparse {
char offset[12]; // offset 0
char numbytes[12]; // offset 12
};
Each such struct describes a block of data that has actually been written to the archive. The offset describes where in the extracted file the data is supposed to start and the numbytes provides the length of the block. When extracting the entry the gaps between the sparse structs are equivalent to areas filled with zero bytes.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | isExtended
If an extension sparse header follows. |
| private final List |
| Access | Constructor and Description |
|---|---|
| public | TarArchiveSparseEntry(final byte[]
The header bytes from a tar archive entry. headerBuf)Constructs an entry from an archive's header bytes. |
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: information about the configuration for the sparse entry.Obtains information about the configuration for the sparse entry. |
| public boolean |
| isExtended | back to summary |
|---|---|
| private final boolean isExtended If an extension sparse header follows. | |
| sparseHeaders | back to summary |
|---|---|
| private final List<TarArchiveStructSparse> sparseHeaders | |
| TarArchiveSparseEntry | back to summary |
|---|---|
| public TarArchiveSparseEntry(final byte[] headerBuf) throws IOException Constructs an entry from an archive's header bytes. File is set to null.
| |
| getSparseHeaders | back to summary |
|---|---|
| public List Obtains information about the configuration for the sparse entry.
| |
| isExtended | back to summary |
|---|---|
| public boolean isExtended() | |