public void growArray ( int amountBits , boolean saveValue ) { size = size + amountBits ; int N = size / 8 + ( size % 8 == 0 ? 0 : 1 ) ; if ( N > data . length ) { // add in some buffer to avoid lots of calls to new int extra = Math . min ( 1024 , N + 10 ) ; byte [ ] tmp = new byte [ N + extra ] ; if ( saveValue ) System . arraycopy ( data , 0 , tmp , 0 , data . length ) ; this . data = tmp ; } }
Increases the size of the data array so that it can store an addition number of bits