Lines Matching refs:buf
235 uint8_t buf[EndOfCentralDir::kMaxEOCDSearch]; in readCentralDir() local
236 if (fread(buf, 1, readAmount, mZipFp) != readAmount) { in readCentralDir()
248 if (buf[i] == 0x50 && in readCentralDir()
249 ZipEntry::getLongLE(&buf[i]) == EndOfCentralDir::kSignature) in readCentralDir()
261 status_t result = mEOCD.readBuf(buf + i, readAmount - i); in readCentralDir()
690 void *buf = pSourceZip->uncompress(pSourceEntry); in addRecompress() local
691 if (buf == NULL) { in addRecompress()
697 if (compressFpToFp(mZipFp, NULL, buf, uncompressedLen, &crc) != OK) { in addRecompress()
700 free(buf); in addRecompress()
706 free(buf); in addRecompress()
1210 bool ZipFile::uncompress(const ZipEntry* pEntry, void* buf) const
1218 BufferWriter(void* buf, size_t size) : Writer(), in BufferWriter() argument
1219 buf_(reinterpret_cast<uint8_t*>(buf)), size_(size), bytes_written_(0) {} in BufferWriter()
1221 bool Append(uint8_t* buf, size_t buf_size) override { in Append() argument
1226 memcpy(buf_ + bytes_written_, buf, buf_size); in Append()
1242 bool ReadAtOffset(uint8_t* buf, size_t len, off64_t offset) const { in ReadAtOffset() argument
1254 size_t read = fread(buf, 1, len, fp_); in ReadAtOffset()
1274 void* buf = malloc(unlen); in uncompress() local
1275 if (buf == NULL) { in uncompress()
1289 ssize_t amt = fread(buf, 1, unlen, mZipFp); in uncompress()
1295 const unsigned char* p = (unsigned char*)buf; in uncompress()
1311 BufferWriter writer(buf, unlen); in uncompress()
1320 return buf; in uncompress()
1323 free(buf); in uncompress()
1340 status_t ZipFile::EndOfCentralDir::readBuf(const uint8_t* buf, int len) in readBuf() argument
1353 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature) in readBuf()
1356 mDiskNumber = ZipEntry::getShortLE(&buf[0x04]); in readBuf()
1357 mDiskWithCentralDir = ZipEntry::getShortLE(&buf[0x06]); in readBuf()
1358 mNumEntries = ZipEntry::getShortLE(&buf[0x08]); in readBuf()
1359 mTotalNumEntries = ZipEntry::getShortLE(&buf[0x0a]); in readBuf()
1360 mCentralDirSize = ZipEntry::getLongLE(&buf[0x0c]); in readBuf()
1361 mCentralDirOffset = ZipEntry::getLongLE(&buf[0x10]); in readBuf()
1362 mCommentLen = ZipEntry::getShortLE(&buf[0x14]); in readBuf()
1373 memcpy(mComment, buf + kEOCDLen, mCommentLen); in readBuf()
1384 uint8_t buf[kEOCDLen]; in write() local
1386 ZipEntry::putLongLE(&buf[0x00], kSignature); in write()
1387 ZipEntry::putShortLE(&buf[0x04], mDiskNumber); in write()
1388 ZipEntry::putShortLE(&buf[0x06], mDiskWithCentralDir); in write()
1389 ZipEntry::putShortLE(&buf[0x08], mNumEntries); in write()
1390 ZipEntry::putShortLE(&buf[0x0a], mTotalNumEntries); in write()
1391 ZipEntry::putLongLE(&buf[0x0c], mCentralDirSize); in write()
1392 ZipEntry::putLongLE(&buf[0x10], mCentralDirOffset); in write()
1393 ZipEntry::putShortLE(&buf[0x14], mCommentLen); in write()
1395 if (fwrite(buf, 1, kEOCDLen, fp) != kEOCDLen) { in write()