pub fn encode_in_writer<T: Write>(content: &[u8], writer: &mut T) -> Result<usize, EncodingError> {
    let required_slice_size = compute_encoded_size(content.len());

    // Complete groups.
    for chunk in content.chunks_exact(8) {
        let encoded = compute_chunk(chunk);

        writer.write_all(&encoded)?;
    }

    // Last incomplete group.
    let last_group_length = content.len() - (content.len() >> 3 << 3);
    if last_group_length != 0 {
        let chunk = &content[content.len() - last_group_length..];
        let encoded = compute_chunk(chunk);
        let elements_to_write = compute_encoded_size(last_group_length);

        writer.write_all(&encoded[..elements_to_write])?;
    }

    Ok(required_slice_size)
}
/// Encodes a list of bytes into a G60 encoding format.
/// The result is writen in `writer`.
///
/// # Errors
/// An error will be thrown if the writing process fails.
Encodes a list of bytes into a G60 encoding format.
The result is writen in `writer`.
Encodes a list of bytes into a G60 encoding format . The result is writen in ` writer ` .
pub fn encode_in_writer<T: Write>(content: &[u8], writer: &mut T) -> Result<usize, EncodingError> {
    let required_slice_size = compute_encoded_size(content.len());
    // Complete groups.
    for chunk in content.chunks_exact(8) {
        let encoded = compute_chunk(chunk);
        writer.write_all(&encoded)?;
    }
    // Last incomplete group.
    let last_group_length = content.len() - (content.len() >> 3 << 3);
    if last_group_length != 0 {
        let chunk = &content[content.len() - last_group_length..];
        let encoded = compute_chunk(chunk);
        let elements_to_write = compute_encoded_size(last_group_length);
        writer.write_all(&encoded[..elements_to_write])?;
    }
    Ok(required_slice_size)
}
pub fn encode_in_writer < T : Write > ( content : & [ u8 ] , writer : & mut T ) -> Result < usize , EncodingError > { let required_slice_size = compute_encoded_size ( content . len ( ) ) ; // Complete groups. for chunk in content . chunks_exact ( 8 ) { let encoded = compute_chunk ( chunk ) ; writer . write_all ( & encoded ) ? ; } // Last incomplete group. let last_group_length = content . len ( ) - ( content . len ( ) >> 3 << 3 ) ; if last_group_length != 0 { let chunk = & content [ content . len ( ) - last_group_length .. ] ; let encoded = compute_chunk ( chunk ) ; let elements_to_write = compute_encoded_size ( last_group_length ) ; writer . write_all ( & encoded [ .. elements_to_write ] ) ? ; } Ok ( required_slice_size ) }
Encodes a list of bytes into a G60 encoding format.
Encodes a list of bytes into a G60 encoding format .
content
&[u8]
writer
&mut T
content
&[u8]
writer
&mut T
errors
An error will be thrown if the writing process fails.
An error will be thrown if the writing process fails .