pub fn read_string<R>(r: &mut Reader<R>) -> io::Result<String>
    where R: Read
{
    let len = read_len_bits(r)?;
    let mut buf = Vec::with_capacity(len);
    for _ in 0 .. len {
        buf.push(r.read_unsigned(8)? as u8);
    }
    match String::from_utf8(buf) {
        Ok(val) => Ok(val),
        Err(err) => Err(io::Error::new(io::ErrorKind::InvalidData, err))
    }
}
/// Reads a string from the reader
Reads a string from the reader
Reads a string from the reader
pub fn read_string<R>(r: &mut Reader<R>) -> io::Result<String>
    where R: Read
{
    let len = read_len_bits(r)?;
    let mut buf = Vec::with_capacity(len);
    for _ in 0 .. len {
        buf.push(r.read_unsigned(8)? as u8);
    }
    match String::from_utf8(buf) {
        Ok(val) => Ok(val),
        Err(err) => Err(io::Error::new(io::ErrorKind::InvalidData, err))
    }
}
pub fn read_string < R > ( r : & mut Reader < R > ) -> io :: Result < String > where R : Read { let len = read_len_bits ( r ) ? ; let mut buf = Vec :: with_capacity ( len ) ; for _ in 0 .. len { buf . push ( r . read_unsigned ( 8 ) ? as u8 ) ; } match String :: from_utf8 ( buf ) { Ok ( val ) => Ok ( val ) , Err ( err ) => Err ( io :: Error :: new ( io :: ErrorKind :: InvalidData , err ) ) } }
Reads a string from the reader
Reads a string from the reader
r
&mut Reader<R>