Skip to content

ExtractTar Method ​

Definition ​

  • Namespace: JASE
  • Assembly: JASE.Compression.dll

Dictionary<string, byte[]> ExtractTar(byte[] tarBytes) ​

csharp
Dictionary<string, byte[]> ExtractTar(byte[] tarBytes)

Extracts the contents of a tar archive from the specified byte array and populates the Files collection.

Parameters ​

NameDescription
tarBytesThe raw bytes of a tar file. The archive is expected to use 512-byte blocks and standard ustar-style headers.

Returns ​

A dictionary mapping file names to their extracted contents, representing the current state of the tarball after extraction.

Remarks ​

Existing entries in Files are cleared before extraction. The method stops reading when it encounters a header block consisting entirely of zero bytes, which is the conventional tar end-of-archive marker.

Only regular file entries are interpreted. Directory entries and extended tar features are not currently parsed.