Lines Matching defs:buf

196             byte[] buf = mIndexHeader;
197 if (mIndexFile.read(buf) != INDEX_HEADER_SIZE) {
202 if (readInt(buf, IH_MAGIC) != MAGIC_INDEX_FILE) {
207 if (readInt(buf, IH_VERSION) != mVersion) {
212 mMaxEntries = readInt(buf, IH_MAX_ENTRIES);
213 mMaxBytes = readInt(buf, IH_MAX_BYTES);
214 mActiveRegion = readInt(buf, IH_ACTIVE_REGION);
215 mActiveEntries = readInt(buf, IH_ACTIVE_ENTRIES);
216 mActiveBytes = readInt(buf, IH_ACTIVE_BYTES);
218 int sum = readInt(buf, IH_CHECKSUM);
219 if (checkSum(buf, 0, IH_CHECKSUM) != sum) {
304 byte[] buf = mIndexHeader;
305 writeInt(buf, IH_MAGIC, MAGIC_INDEX_FILE);
306 writeInt(buf, IH_MAX_ENTRIES, maxEntries);
307 writeInt(buf, IH_MAX_BYTES, maxBytes);
308 writeInt(buf, IH_ACTIVE_REGION, 0);
309 writeInt(buf, IH_ACTIVE_ENTRIES, 0);
310 writeInt(buf, IH_ACTIVE_BYTES, DATA_HEADER_SIZE);
311 writeInt(buf, IH_VERSION, mVersion);
312 writeInt(buf, IH_CHECKSUM, checkSum(buf, 0, IH_CHECKSUM));
313 mIndexFile.write(buf);
321 writeInt(buf, 0, MAGIC_DATA_FILE);
322 mDataFile0.write(buf, 0, 4);
323 mDataFile1.write(buf, 0, 4);
640 static int readInt(byte[] buf, int offset) {
641 return (buf[offset] & 0xff)
642 | ((buf[offset + 1] & 0xff) << 8)
643 | ((buf[offset + 2] & 0xff) << 16)
644 | ((buf[offset + 3] & 0xff) << 24);
647 static long readLong(byte[] buf, int offset) {
648 long result = buf[offset + 7] & 0xff;
650 result = (result << 8) | (buf[offset + i] & 0xff);
655 static void writeInt(byte[] buf, int offset, int value) {
657 buf[offset + i] = (byte) (value & 0xff);
662 static void writeLong(byte[] buf, int offset, long value) {
664 buf[offset + i] = (byte) (value & 0xff);