public int append ( byte [ ] b , int offset , int length ) { int oldLength = bytesLength ; bytesLength += length ; int newCapacity = capacityPolicy . ensureCapacity ( bytesLength , bytes . length ) ; if ( newCapacity > bytes . length ) { byte [ ] newB = new byte [ newCapacity ] ; System . arraycopy ( bytes , 0 , newB , 0 , bytes . length ) ; // copy current bytes to new bytes bytes = newB ; } System . arraycopy ( b , offset , bytes , oldLength , length ) ; // assign value normalizeCommandLength ( ) ; return bytesLength ; }
Append bytes to specified offset and length .