pub struct ByteBlock(pub Vec<u8>);Expand description
Datablock that consists of a list of bytes.
It is possible to store any block of data in a ByteBlock,
but that would require to know the Endianness of the file
beforehand, so the bytes are written in the correct order.
Using a Datablock, on the other hand, allows to make use
of the functionality of an EndianFile, so the data can be
written without worrying about the endianness.
Tuple Fields§
§0: Vec<u8>Implementations§
Source§impl ByteBlock
impl ByteBlock
Sourcepub fn offsets(blocks: Vec<Vec<u8>>) -> Offsets<ByteBlock>
pub fn offsets(blocks: Vec<Vec<u8>>) -> Offsets<ByteBlock>
Constructs an Offsets of ByteBlocks from a vector of
vectors of bytes.
Each vector of bytes represents one ByteBlock.
Sourcepub fn single(block: Vec<u8>) -> Offsets<ByteBlock>
pub fn single(block: Vec<u8>) -> Offsets<ByteBlock>
Constructs an Offsets from a vector of bytes.
This vector of bytes represents a single ByteBlock.
Trait Implementations§
Source§impl Datablock for ByteBlock
impl Datablock for ByteBlock
Source§fn write_to(self, file: &mut EndianFile) -> Result<()>
fn write_to(self, file: &mut EndianFile) -> Result<()>
Writes this
Datablock to an EndianFile. The number of bytes
written must be exactly same number as returned by size(&self). Read more