Function bitconv::to_int64 [−][src]
pub fn to_int64<T: BitConvEndian>(data: &[u8], start_index: usize) -> i64
Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array.
The to_int64
function converts the bytes from index start_index to
start_index + 7 to a i64
value.
Example
use bitconv::{ endian::{Big, Little}, to_int64 }; let buffer = [15, 0, 0, 128, 16, 39, 240, 216, 241, 255, 127]; assert_eq!(-1019801265028202496, to_int64::<Little>(&buffer, 1)); assert_eq!(140806877927665, to_int64::<Big>(&buffer, 1));