private void copyToStrBuffer ( byte [ ] buffer , int offset , int length ) { Preconditions . checkArgument ( length >= 0 ) ; if ( strBuffer . length - strBufferIndex < length ) { // cannot fit, expanding buffer expandStrBuffer ( length ) ; } System . arraycopy ( buffer , offset , strBuffer , strBufferIndex , Math . min ( length , MAX_ALLOWABLE_BUFFER_SIZE - strBufferIndex ) ) ; strBufferIndex += length ; }
Copies from buffer to our internal strBufferIndex expanding the internal buffer if necessary