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

unsigned long tar_input_filter_gunzip::get_long (  )  [private]

The get_long method is used to read a little-endian 4-byte value from the input stream.

Definition at line 152 of file gunzip.cc.

References buffered_read(), and tar_input::fatal().

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

{
    unsigned char buffer[4];
    unsigned char *bp = buffer;
    size_t len = sizeof(buffer);
    for (;;)
    {
      //
      // weird block boundaries can mess this up.
      //
      size_t nbytes = buffered_read(bp, len);
      if (nbytes == 0)
          fatal("short read");
      len -= nbytes;
      if (!len)
          break;
      bp += nbytes;
    }
    return
      (
          (unsigned long)buffer[0]
      |
          ((unsigned long)buffer[1] << 8)
      |
          ((unsigned long)buffer[2] << 16)
      |
          ((unsigned long)buffer[3] << 24)
      );
}


Generated by  Doxygen 1.6.0   Back to index