Function std::io::extensions::u64_to_be_bytes[src]
pub fn u64_to_be_bytes<T>(n: u64, size: uint, f: |v: &[u8]| -> T) -> T
Converts an 8-bit to 64-bit unsigned value to a big-endian byte representation of the given size. If the size is not big enough to represent the value, then the high-order bytes are truncated.
Arguments:
n: The value to convert.size: The size of the value, in bytes. This must be 8 or less, or task failure occurs. If this is less than 8, then a value of that many bytes is produced. For example, ifsizeis 4, then a 32-bit byte representation is produced.f: A callback that receives the value.
This function returns the value returned by the callback, for convenience.