rar_stream/parsing/terminator_header.rs
1//! Terminator header parser.
2//!
3//! The terminator header marks the end of a RAR archive.
4
5use crate::error::{RarError, Result};
6
7pub struct TerminatorHeaderParser;
8
9impl TerminatorHeaderParser {
10 pub const HEADER_SIZE: usize = 7;
11
12 pub fn parse(buffer: &[u8]) -> Result<()> {
13 if buffer.len() < Self::HEADER_SIZE {
14 return Err(RarError::BufferTooSmall {
15 needed: Self::HEADER_SIZE,
16 have: buffer.len(),
17 });
18 }
19 // Just validate we have enough bytes - actual terminator is 0x7B type
20 Ok(())
21 }
22}