public void makeSpace ( int numFields ) { final int oldNumFields = this . numFields ; // increase the number of fields in the arrays if ( this . offsets == null ) { this . offsets = new int [ numFields ] ; } else if ( this . offsets . length < numFields ) { int [ ] newOffs = new int [ Math . max ( numFields + 1 , oldNumFields << 1 ) ] ; System . arraycopy ( this . offsets , 0 , newOffs , 0 , oldNumFields ) ; this . offsets = newOffs ; } if ( this . lengths == null ) { this . lengths = new int [ numFields ] ; } else if ( this . lengths . length < numFields ) { int [ ] newLens = new int [ Math . max ( numFields + 1 , oldNumFields << 1 ) ] ; System . arraycopy ( this . lengths , 0 , newLens , 0 , oldNumFields ) ; this . lengths = newLens ; } if ( this . readFields == null ) { this . readFields = new Value [ numFields ] ; } else if ( this . readFields . length < numFields ) { Value [ ] newFields = new Value [ Math . max ( numFields + 1 , oldNumFields << 1 ) ] ; System . arraycopy ( this . readFields , 0 , newFields , 0 , oldNumFields ) ; this . readFields = newFields ; } if ( this . writeFields == null ) { this . writeFields = new Value [ numFields ] ; } else if ( this . writeFields . length < numFields ) { Value [ ] newFields = new Value [ Math . max ( numFields + 1 , oldNumFields << 1 ) ] ; System . arraycopy ( this . writeFields , 0 , newFields , 0 , oldNumFields ) ; this . writeFields = newFields ; } }
Reserves space for at least the given number of fields in the internal arrays .