MCPcopy Create free account
hub / github.com/cretz/stackparam / read_n

Method read_n

src/bytecode/io/reader.rs:955–965  ·  view source on GitHub ↗
(&mut self, count: usize)

Source from the content-addressed store, hash-verified

953 }
954
955 pub fn read_n(&mut self, count: usize) -> Result<Vec<u8>, Error> {
956 let mut tmp: Vec<u8> = Vec::with_capacity(count);
957
958 match self.source.take(count as u64).read_to_end(&mut tmp) {
959 Ok(_) => {
960 self.position += count;
961 Ok(tmp)
962 },
963 Err(err) => Err(err)
964 }
965 }
966
967 pub fn get_n(&mut self, count: usize) -> Vec<u8> {
968 match self.read_n(count) {

Callers 4

read_constantMethod · 0.80
read_attributeMethod · 0.80
require_nMethod · 0.80
get_nMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected