Lines Matching defs:buf

207     unsigned char* buf = NULL;
223 buf = new unsigned char[EndOfCentralDir::kMaxEOCDSearch];
224 if (buf == NULL) {
245 if (fread(buf, 1, readAmount, mZipFp) != (size_t) readAmount) {
253 if (buf[i] == 0x50 &&
254 ZipEntry::getLongLE(&buf[i]) == EndOfCentralDir::kSignature)
256 ALOGV("+++ Found EOCD at buf+%d\n", i);
267 result = mEOCD.readBuf(buf + i, readAmount - i);
341 delete[] buf;
1141 bool ZipFile::uncompress(const ZipEntry* pEntry, void* buf) const
1153 void* buf = malloc(unlen);
1154 if (buf == NULL) {
1168 ssize_t amt = fread(buf, 1, unlen, mZipFp);
1174 const unsigned char* p = (unsigned char*)buf;
1189 if (!ZipUtils::inflateToBuffer(mZipFp, buf, unlen, clen)) {
1197 return buf;
1200 free(buf);
1214 * "buf" should be positioned at the EOCD signature, and should contain
1217 status_t ZipFile::EndOfCentralDir::readBuf(const unsigned char* buf, int len)
1230 if (ZipEntry::getLongLE(&buf[0x00]) != kSignature)
1233 mDiskNumber = ZipEntry::getShortLE(&buf[0x04]);
1234 mDiskWithCentralDir = ZipEntry::getShortLE(&buf[0x06]);
1235 mNumEntries = ZipEntry::getShortLE(&buf[0x08]);
1236 mTotalNumEntries = ZipEntry::getShortLE(&buf[0x0a]);
1237 mCentralDirSize = ZipEntry::getLongLE(&buf[0x0c]);
1238 mCentralDirOffset = ZipEntry::getLongLE(&buf[0x10]);
1239 mCommentLen = ZipEntry::getShortLE(&buf[0x14]);
1250 memcpy(mComment, buf + kEOCDLen, mCommentLen);
1261 unsigned char buf[kEOCDLen];
1263 ZipEntry::putLongLE(&buf[0x00], kSignature);
1264 ZipEntry::putShortLE(&buf[0x04], mDiskNumber);
1265 ZipEntry::putShortLE(&buf[0x06], mDiskWithCentralDir);
1266 ZipEntry::putShortLE(&buf[0x08], mNumEntries);
1267 ZipEntry::putShortLE(&buf[0x0a], mTotalNumEntries);
1268 ZipEntry::putLongLE(&buf[0x0c], mCentralDirSize);
1269 ZipEntry::putLongLE(&buf[0x10], mCentralDirOffset);
1270 ZipEntry::putShortLE(&buf[0x14], mCommentLen);
1272 if (fwrite(buf, 1, kEOCDLen, fp) != kEOCDLen)