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

size_t ByteStream::writall ( const void *  buffer,
size_t  size 
) [inherited]

Writes data and blocks until everything has been written. This function is essentially similar to function write#. Unlike function write# however, function writall# will only return after all size# bytes have been written. This is implemented by repeatedly calling function write# until everything is written. Note that write# and writall# are equivalent when size# is one.

Definition at line 463 of file ByteStream.cpp.

References ByteStream::write().

Referenced by ByteStream::copy(), DjVuTXT::encode(), DjVuNavDir::encode(), DjVuANT::encode(), ByteStream::Memory::init(), DjVuDocEditor::save_as(), GBitmap::save_pbm(), GBitmap::save_pgm(), GPixmap::save_ppm(), GBitmap::save_rle(), DjVuDocument::write(), ByteStream::write16(), ByteStream::write24(), ByteStream::write32(), and ByteStream::writestring().

{
  size_t total = 0;
  while (size > 0)
    {
      size_t nitems = write(buffer, size);
      if (nitems == 0)
        G_THROW( ERR_MSG("ByteStream.write_error") );      //  Unknown error in write
      total += nitems;
      size -= nitems; 
      buffer = (void*)((char*)buffer + nitems);
    }
  return total;
}


Generated by  Doxygen 1.6.0   Back to index