src/io.cpp
// Does not write num_bytes into file
Does not write num_bytes into file
Does not write num_bytes into file
void Writer::WriteNBytes(unsigned char *bytes, unsigned int num_bytes) {
  if ((int)num_bytes > buf_size_) {
    Flush();
    while ((int)num_bytes > buf_size_) {
      buf_size_ *= 2;
      buf_.reset(new unsigned char[buf_size_]);
      buf_ptr_ = buf_.get();
      end_buf_ = buf_.get() + buf_size_;
    }
  }
  if (buf_ptr_ + num_bytes > end_buf_) {
    Flush();
  }
  memcpy(buf_ptr_, bytes, num_bytes);
  buf_ptr_ += num_bytes;
}
void Writer :: WriteNBytes ( unsigned char * bytes , unsigned int num_bytes ) { if ( ( int ) num_bytes > buf_size_ ) { Flush ( ) ; while ( ( int ) num_bytes > buf_size_ ) { buf_size_ *= 2 ; buf_ . reset ( new unsigned char [ buf_size_ ] ) ; buf_ptr_ = buf_ . get ( ) ; end_buf_ = buf_ . get ( ) + buf_size_ ; } } if ( buf_ptr_ + num_bytes > end_buf_ ) { Flush ( ) ; } memcpy ( buf_ptr_ , bytes , num_bytes ) ; buf_ptr_ += num_bytes ; }
Does not write num_bytes into file
Does not write num_bytes into file