CommentHeader.cs 850 B

12345678910111213141516171819202122232425262728
  1. using SharpCompress.IO;
  2. namespace SharpCompress.Common.Rar.Headers
  3. {
  4. internal class CommentHeader : RarHeader
  5. {
  6. protected CommentHeader(RarHeader header, RarCrcBinaryReader reader)
  7. : base(header, reader, HeaderType.Comment)
  8. {
  9. if (IsRar5) throw new InvalidFormatException("unexpected rar5 record");
  10. }
  11. protected override void ReadFinish(MarkingBinaryReader reader)
  12. {
  13. UnpSize = reader.ReadInt16();
  14. UnpVersion = reader.ReadByte();
  15. UnpMethod = reader.ReadByte();
  16. CommCrc = reader.ReadInt16();
  17. }
  18. internal short UnpSize { get; private set; }
  19. internal byte UnpVersion { get; private set; }
  20. internal byte UnpMethod { get; private set; }
  21. internal short CommCrc { get; private set; }
  22. }
  23. }