pub fn read_value_finish<R: io::Read>(rd: &mut R, prefix: &ValuePrefix, content: &mut Vec<u8>)
    -> Result<(), HashStoreError>
{

    if prefix.size as usize > content.len() {
        let bytes_todo = prefix.size as usize - content.len();

        let mut buffer = vec![0; bytes_todo];
        rd.read_exact(&mut buffer)?;
        content.append(&mut buffer);

    }
    Ok(())
}
// Reads any remaining bytes of the value
// Must be called after read_value_start if the full value is needed
Reads any remaining bytes of the value
Must be called after read_value_start if the full value is needed
Reads any remaining bytes of the value Must be called after read_value_start if the full value is needed
pub fn read_value_finish<R: io::Read>(rd: &mut R, prefix: &ValuePrefix, content: &mut Vec<u8>)
    -> Result<(), HashStoreError>
{
    if prefix.size as usize > content.len() {
        let bytes_todo = prefix.size as usize - content.len();
        let mut buffer = vec![0; bytes_todo];
        rd.read_exact(&mut buffer)?;
        content.append(&mut buffer);
    }
    Ok(())
}
pub fn read_value_finish < R : io :: Read > ( rd : & mut R , prefix : & ValuePrefix , content : & mut Vec < u8 > ) -> Result < ( ) , HashStoreError > { if prefix . size as usize > content . len ( ) { let bytes_todo = prefix . size as usize - content . len ( ) ; let mut buffer = vec ! [ 0 bytes_todo ] ; rd . read_exact ( & mut buffer ) ? ; content . append ( & mut buffer ) ; } Ok ( ( ) ) }
Reads any remaining bytes of the value
Must be called after read_value_start if the full value is needed
Reads any remaining bytes of the value Must be called after read_value_start if the full value is needed
rd
&mut R
prefix
&ValuePrefix
content
&mut Vec<u8>
rd
&mut R
prefix
&ValuePrefix
content
&mut Vec<u8>