Skip to main content

read_bytes

Function read_bytes 

Source
pub fn read_bytes<'a>(
    account: &'a AccountView<'a>,
    offset: usize,
    len: usize,
) -> Result<Ref<'a, [u8]>, ProgramError>
Expand description

Read a byte slice from account data.

Returns a reference to len bytes starting at offset. Useful for reading variable-length fields when you know the layout.