Code example for MappedByteBuffer

Methods: force

0
            mDataFile0.getFD().sync();
        } catch (Throwable t) {
            Log.w(TAG, "sync data file 0 failed", t);
        } 
        try { 
            mDataFile1.getFD().sync();
        } catch (Throwable t) {
            Log.w(TAG, "sync data file 1 failed", t);
        } 
    } 
 
    // This is for testing only. 
    // 
    // Returns the active count (mActiveEntries). This also verifies that 
    // the active count matches matches what's inside the hash region. 
    int getActiveCount() { 
        int count = 0;
        for (int i = 0; i < mMaxEntries; i++) {
            int offset = mActiveHashStart + i * 12;
            long candidateKey = mIndexBuffer.getLong(offset);
            int candidateOffset = mIndexBuffer.getInt(offset + 8);