Lines Matching refs:buffer
229 size_t SkFILEStream::read(void* buffer, size_t size)
233 if (buffer == NULL && size == 0) // special signature, they want the total size
236 return sk_fread(buffer, size, fFILE);
310 size_t SkMemoryStream::read(void* buffer, size_t size)
312 if (buffer == NULL && size == 0) // special signature, they want the total size
315 // if buffer is NULL, seek ahead by size
321 if (buffer) {
322 memcpy(buffer, (const char*)fSrc + fOffset, size);
356 SkBufferStream::SkBufferStream(SkStream* proxy, void* buffer, size_t bufferSize)
360 SkASSERT(buffer == NULL || bufferSize != 0); // init(addr, 0) makes no sense, we must know how big their buffer is
362 this->init(buffer, bufferSize);
365 void SkBufferStream::init(void* buffer, size_t bufferSize)
374 if (buffer == NULL)
381 fBuffer = (char*)buffer;
408 size_t SkBufferStream::read(void* buffer, size_t size) {
413 if (buffer == NULL && size == 0) {
414 return fProxy->read(buffer, size); // requesting total size
422 if (NULL == buffer) {
428 // if we get here, we are being asked to skip beyond our current buffer
443 memcpy(buffer, fBuffer + fBufferOffset, s);
449 buffer = (char*)buffer + s;
468 memcpy(buffer, fBuffer, size);
476 fBufferSize = s; // record the (possibly smaller) size for the buffer
480 actuallyRead += fProxy->read(buffer, size);
511 bool SkFILEWStream::write(const void* buffer, size_t size)
516 if (sk_fwrite(buffer, size, fFILE) != size)
534 SkMemoryWStream::SkMemoryWStream(void* buffer, size_t size)
535 : fBuffer((char*)buffer), fMaxLength(size), fBytesWritten(0)
539 bool SkMemoryWStream::write(const void* buffer, size_t size)
544 memcpy(fBuffer + fBytesWritten, buffer, size);
612 bool SkDynamicMemoryWStream::write(const void* buffer, size_t count)
626 buffer = fTail->append(buffer, size);
636 block->append(buffer, count);
647 bool SkDynamicMemoryWStream::write(const void* buffer, size_t offset, size_t count)
656 memcpy(block->start() + offset, buffer, part);
660 buffer = (const void*) ((char* ) buffer + part);
668 bool SkDynamicMemoryWStream::read(void* buffer, size_t offset, size_t count)
677 memcpy(buffer, block->start() + offset, part);
681 buffer = (void*) ((char* ) buffer + part);
729 bool SkDebugWStream::write(const void* buffer, size_t size)
733 memcpy(s, buffer, size);