mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-11-16 09:20:25 +00:00
* Locate the PKZIP file data instead of reading it into the model Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep only the offset of the PKZIP file data The length is the compressed size from the local file header or the ZIP64 extended field, which the printer already shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the file data property as a comment for documentation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
namespace SabreTools.Data.Models.PKZIP
|
|
{
|
|
/// <summary>
|
|
/// PKZIP local file
|
|
/// </summary>
|
|
/// <see href="https://petlibrary.tripod.com/ZIP.HTM"/>
|
|
/// <see href="https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT"/>
|
|
public class LocalFile
|
|
{
|
|
/// <summary>
|
|
/// Local file header
|
|
/// </summary>
|
|
public LocalFileHeader LocalFileHeader { get; set; } = new();
|
|
|
|
/// <summary>
|
|
/// Encryption header
|
|
/// </summary>
|
|
/// TODO: Determine the model for the encryption headers
|
|
public byte[] EncryptionHeaders { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// File data, appears after the encryption header
|
|
/// if it exists or after the local file header otherwise
|
|
/// </summary>
|
|
/// Not read into the model, see <see cref="FileDataOffset"/>
|
|
// public byte[] FileData { get; set; } = [];
|
|
|
|
/// <summary>
|
|
/// Offset of the file data in the stream
|
|
/// </summary>
|
|
public long FileDataOffset { get; set; }
|
|
|
|
/// <summary>
|
|
/// Data descriptors, appears after the file data
|
|
/// </summary>
|
|
/// <remarks>Cannot exist if <see cref="ZIP64DataDescriptor"/> is populated</remarks>
|
|
public DataDescriptor? DataDescriptor { get; set; }
|
|
|
|
/// <summary>
|
|
/// ZIP64 Data descriptors, appears after the file data
|
|
/// </summary>
|
|
/// <remarks>Cannot exist if <see cref="DataDescriptor"/> is populated</remarks>
|
|
public DataDescriptor64? ZIP64DataDescriptor { get; set; }
|
|
}
|
|
}
|