Lines Matching refs:size

24     size_t read(void* buffer, size_t size) override;
26 size_t peek(void* buffer, size_t size) const override;
47 // Total size of the buffer.
53 // Read up to size bytes from already buffered data, and copy to
56 size_t readFromBuffer(char* dst, size_t size);
58 // Buffer up to size bytes from the stream, and copy to dst if non-
60 // less than fBufferedSoFar, and size is greater than 0.
61 size_t bufferAndWriteTo(char* dst, size_t size);
63 // Read up to size bytes directly from the stream and into dst if non-
65 // data, and size is greater than 0.
66 size_t readDirectlyFromStream(char* dst, size_t size);
128 size_t FrontBufferedStream::readFromBuffer(char* dst, size_t size) {
131 // lesser of the size requested and the remainder of the buffered
133 const size_t bytesToCopy = std::min(size, fBufferedSoFar - fOffset);
146 size_t FrontBufferedStream::bufferAndWriteTo(char* dst, size_t size) {
147 SkASSERT(size > 0);
150 // Data needs to be buffered. Buffer up to the lesser of the size requested
151 // and the remainder of the max buffer size.
152 const size_t bytesToBuffer = std::min(size, fBufferSize - fBufferedSoFar);
168 size_t FrontBufferedStream::readDirectlyFromStream(char* dst, size_t size) {
169 SkASSERT(size > 0);
173 const size_t bytesReadDirectly = fStream->read(dst, size);
186 size_t FrontBufferedStream::peek(void* dst, size_t size) const {
195 size = std::min(size, fBufferSize - start);
197 const size_t bytesRead = nonConstThis->read(dst, size);
202 size_t FrontBufferedStream::read(void* voidDst, size_t size) {
205 SkDEBUGCODE(const size_t totalSize = size;)
210 const size_t bytesCopied = this->readFromBuffer(dst, size);
214 size -= bytesCopied;
215 SkASSERT(size + (fOffset - start) == totalSize);
223 if (size > 0 && fBufferedSoFar < fBufferSize && !fStream->isAtEnd()) {
224 const size_t buffered = this->bufferAndWriteTo(dst, size);
228 size -= buffered;
229 SkASSERT(size + (fOffset - start) == totalSize);
235 if (size > 0 && !fStream->isAtEnd()) {
236 SkDEBUGCODE(const size_t bytesReadDirectly =) this->readDirectlyFromStream(dst, size);
237 SkDEBUGCODE(size -= bytesReadDirectly;)
238 SkASSERT(size + (fOffset - start) == totalSize);