amebazii

Macro read_padding

Source
macro_rules! read_padding {
    ($reader:expr, $size:expr) => { ... };
}
Expand description

Read (skip) padding bytes in a reader.

This macro skips a specified number of bytes in the stream, commonly used when there is padding between fields in a binary format.

§Parameters:

  • $reader: The reader to skip the padding in. This must implement the std::io::Read and std::io::Seek traits.
  • $size: The number of bytes to skip. This will be passed to the seek function in the form of SeekFrom::Current.

§Example:

use std::io::Cursor;
let mut buffer = Cursor::new(Vec::new());
read_padding!(buffer, 16); // Skips 16 bytes in the buffer