Moving this var outside the caching part, it will be inconsistent with the mCurrentBlockLeftByte. For example, the caching fails which prints out some warnings(not breaking the process). And the mWrittenBytes is updated meanwhile the mCurrrentBlockLeftByte is not.