private byte [ ] requestChunk ( int requestedSize ) { mPosInChunk = 0 ; if ( mCurrentChunkIndex ++ < mChunkList . size ( ) - 1 ) { // there is one more unused buffer in the list, return it return mCurrentChunk = mChunkList . get ( mCurrentChunkIndex ) ; } mChunkList . add ( mCurrentChunk = new byte [ Math . max ( requestedSize , mMinChunkSize ) ] ) ; return mCurrentChunk ; }
Request a new current chunk .