mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-23 07:14:57 +00:00
Start documenting BZip in code
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
namespace SabreTools.Data.Models.BZip2
|
||||
{
|
||||
/// <summary>
|
||||
/// This is a placeholder model for future work
|
||||
/// </summary>
|
||||
/// <see href="https://github.com/dsnet/compress/blob/master/doc/bzip2-format.pdf"/>
|
||||
public class Archive
|
||||
{
|
||||
/// <summary>
|
||||
/// Stream header
|
||||
/// </summary>
|
||||
public Header? Header { get; set; }
|
||||
|
||||
// TODO: Implement remaining structures
|
||||
|
||||
/// <summary>
|
||||
/// Stream footer
|
||||
/// </summary>
|
||||
public Footer? Footer { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
27
SabreTools.Serialization/Models/BZip2/Footer.cs
Normal file
27
SabreTools.Serialization/Models/BZip2/Footer.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace SabreTools.Data.Models.BZip2
|
||||
{
|
||||
public class Footer
|
||||
{
|
||||
/// <summary>
|
||||
/// A 48-bit integer value 17 72 45 38 50 90, which
|
||||
/// is the binary-coded decimal representation of
|
||||
/// sqrt(pi). It is used to differentiate the block
|
||||
/// from the footer.
|
||||
/// </summary>
|
||||
/// <remarks>This may not be byte-aligned</remarks>
|
||||
public byte[]? Magic { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Contains a custom checksum computed using each of
|
||||
/// the Block CRCs.
|
||||
/// </summary>
|
||||
/// <remarks>This may not be byte-aligned</remarks>
|
||||
public uint Checksum { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used to align the bit-stream to the next byte-aligned
|
||||
/// edge and will contain between 0 and 7 bits.
|
||||
/// </summary>
|
||||
public byte Padding { get; set; }
|
||||
}
|
||||
}
|
||||
25
SabreTools.Serialization/Models/BZip2/Header.cs
Normal file
25
SabreTools.Serialization/Models/BZip2/Header.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace SabreTools.Data.Models.BZip2
|
||||
{
|
||||
public class Header
|
||||
{
|
||||
/// <summary>
|
||||
/// "BZ"
|
||||
/// </summary>
|
||||
public string? Signature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Version byte
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// '0' indicates a BZ1 file
|
||||
/// 'h' indicates a BZ2 file
|
||||
/// </remarks>
|
||||
public byte Version { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ASCII value of the compression level
|
||||
/// </summary>
|
||||
/// <remarks>Valid values between '1' and '9'</remarks>
|
||||
public byte Level { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user