(buf: &[u8], pos: usize)
| 65 | |
| 66 | #[inline(always)] |
| 67 | fn read_u64_be(buf: &[u8], pos: usize) -> Option<u64> { |
| 68 | let bytes = buf.get(pos..pos + 8)?; |
| 69 | Some(u64::from_be_bytes([ |
| 70 | bytes[0], bytes[1], bytes[2], bytes[3], bytes[4], bytes[5], bytes[6], bytes[7], |
| 71 | ])) |
| 72 | } |
| 73 | |
| 74 | /// Return `Some(offset + size)` only if the buffer has enough bytes. |
| 75 | #[inline(always)] |
no test coverage detected