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 thestd::io::Read
andstd::io::Seek
traits.$size
: The number of bytes to skip. This will be passed to theseek
function in the form ofSeekFrom::Current
.
§Example:
use std::io::Cursor;
let mut buffer = Cursor::new(Vec::new());
read_padding!(buffer, 16); // Skips 16 bytes in the buffer