예제 #1
0
파일: SkRawCodec.cpp 프로젝트: mokacao/skia
    // For dng_stream
    void read(void* data, uint32 count, uint64 offset) {
        if (count == 0 && offset == 0) {
            return;
        }
        size_t sum;
        if (!safe_add_to_size_t(static_cast<uint64>(count), offset, &sum) ||
            !this->bufferMoreData(sum)) {
            ThrowReadFile();
        }

        if (!fStreamBuffer.read(data, static_cast<size_t>(offset), count)) {
            ThrowReadFile();
        }
    }
예제 #2
0
 void DoRead(void* data, uint32 count, uint64 offset) override {
     size_t sum;
     if (!safe_add_to_size_t(static_cast<uint64>(count), offset, &sum) ||
         !fStream->read(data, static_cast<size_t>(offset), static_cast<size_t>(count))) {
         ThrowReadFile();
     }
 }
예제 #3
0
 uint64 getLength() override {
     if (!this->bufferMoreData(kReadToEnd)) {  // read whole stream
         ThrowReadFile();
     }
     return fStreamBuffer.bytesWritten();
 }