pub fn stream_length<S: Seek>(stream: &mut S) -> Result<u64>
Get the length of a stream by seeking to the end and then restoring the previous position.