fn new_for_buffered(buffered_byte_writer: W, headers: Headers, pedantic: bool) -> Result<(MetaData, Self)> {
        let mut write = Tracking::new(buffered_byte_writer);
        let requirements = MetaData::write_validating_to_buffered(&mut write, headers.as_slice(), pedantic)?;

        // TODO: use increasing line order where possible, but this requires us to know whether we want to be parallel right now
        /*// if non-parallel compression, we always use increasing order anyways
        if !parallel || !has_compression {
            for header in &mut headers {
                if header.line_order == LineOrder::Unspecified {
                    header.line_order = LineOrder::Increasing;
                }
            }
        }*/

        let offset_table_size: usize = headers.iter().map(|header| header.chunk_count).sum();

        let offset_table_start_byte = write.byte_position();
        let offset_table_end_byte = write.byte_position() + offset_table_size * u64::BYTE_SIZE;

        // skip offset tables, filling with 0, will be updated after the last chunk has been written
        write.seek_write_to(offset_table_end_byte)?;

        let header_count = headers.len();
        let chunk_indices_increasing_y = headers.iter()
            .map(|header| vec![0_u64; header.chunk_count]).collect();

        let meta_data = MetaData { requirements, headers };

        Ok((meta_data, ChunkWriter {
            header_count,
            byte_writer: write,
            chunk_count: offset_table_size,
            chunk_indices_byte_location: offset_table_start_byte .. offset_table_end_byte,
            chunk_indices_increasing_y,
        }))
    }
/// Writes the meta data and zeroed offset tables as a placeholder.
Writes the meta data and zeroed offset tables as a placeholder.
Writes the meta data and zeroed offset tables as a placeholder .
fn new_for_buffered(buffered_byte_writer: W, headers: Headers, pedantic: bool) -> Result<(MetaData, Self)> {
        let mut write = Tracking::new(buffered_byte_writer);
        let requirements = MetaData::write_validating_to_buffered(&mut write, headers.as_slice(), pedantic)?;
        // TODO: use increasing line order where possible, but this requires us to know whether we want to be parallel right now
        /*// if non-parallel compression, we always use increasing order anyways
        if !parallel || !has_compression {
            for header in &mut headers {
                if header.line_order == LineOrder::Unspecified {
                    header.line_order = LineOrder::Increasing;
                }
            }
        }*/
        let offset_table_size: usize = headers.iter().map(|header| header.chunk_count).sum();
        let offset_table_start_byte = write.byte_position();
        let offset_table_end_byte = write.byte_position() + offset_table_size * u64::BYTE_SIZE;
        // skip offset tables, filling with 0, will be updated after the last chunk has been written
        write.seek_write_to(offset_table_end_byte)?;
        let header_count = headers.len();
        let chunk_indices_increasing_y = headers.iter()
            .map(|header| vec![0_u64; header.chunk_count]).collect();
        let meta_data = MetaData { requirements, headers };
        Ok((meta_data, ChunkWriter {
            header_count,
            byte_writer: write,
            chunk_count: offset_table_size,
            chunk_indices_byte_location: offset_table_start_byte .. offset_table_end_byte,
            chunk_indices_increasing_y,
        }))
    }
fn new_for_buffered ( buffered_byte_writer : W , headers : Headers , pedantic : bool ) -> Result < ( MetaData , Self ) > { let mut write = Tracking :: new ( buffered_byte_writer ) ; let requirements = MetaData :: write_validating_to_buffered ( & mut write , headers . as_slice ( ) , pedantic ) ? ; // TODO: use increasing line order where possible, but this requires us to know whether we want to be parallel right now /*// if non-parallel compression, we always use increasing order anyways
        if !parallel || !has_compression {
            for header in &mut headers {
                if header.line_order == LineOrder::Unspecified {
                    header.line_order = LineOrder::Increasing;
                }
            }
        }*/ let offset_table_size : usize = headers . iter ( ) . map ( | header | header . chunk_count ) . sum ( ) ; let offset_table_start_byte = write . byte_position ( ) ; let offset_table_end_byte = write . byte_position ( ) + offset_table_size * u64 :: BYTE_SIZE ; // skip offset tables, filling with 0, will be updated after the last chunk has been written write . seek_write_to ( offset_table_end_byte ) ? ; let header_count = headers . len ( ) ; let chunk_indices_increasing_y = headers . iter ( ) . map ( | header | vec ! [ 0_u64 header chunk_count ] ) . collect ( ) ; let meta_data = MetaData { requirements , headers } ; Ok ( ( meta_data , ChunkWriter { header_count , byte_writer : write , chunk_count : offset_table_size , chunk_indices_byte_location : offset_table_start_byte .. offset_table_end_byte , chunk_indices_increasing_y , } ) ) }
Writes the meta data and zeroed offset tables as a placeholder.
Writes the meta data and zeroed offset tables as a placeholder .
buffered_byte_writer
W
headers
Headers
pedantic
bool
buffered_byte_writer
W
headers
Headers
pedantic
bool