Logo Search packages:      
Sourcecode: tardy version File versions  Download package

int tar_input_filter_gunzip::buffered_read ( void *  data,
int  len 
) [private]

The buffered_read method is used to read some data from the deeper file, possibly coping with data which has been "pushed back" into the stream.

Definition at line 74 of file gunzip.cc.

References buffered_data, buffered_data_pos, buffered_data_size, deflated_file_length, deflated_file_pos, and tar_input_filter::read_data().

Referenced by buffered_getc(), get_long(), read_data(), read_data_padding(), and read_header().

{
    if (buffered_data_pos < buffered_data_size)
    {
      int nbytes = buffered_data_size - buffered_data_pos;
      if (nbytes > len)
          nbytes = len;
      memcpy(data, buffered_data + buffered_data_pos, nbytes);
      buffered_data_pos += nbytes;
      deflated_file_pos += nbytes;
      return nbytes;
    }
    if (deflated_file_pos >= deflated_file_length)
      return 0;
    int nbytes = deflated_file_length - deflated_file_pos;
    if (nbytes > len)
      nbytes = len;
    int nbytes2 = tar_input_filter::read_data(data, nbytes);
    deflated_file_pos += nbytes2;
    return nbytes2;
}


Generated by  Doxygen 1.6.0   Back to index