public ObjectBigArray(Object initialValue) { this.initialValue = initialValue; array = new Object[INITIAL_SEGMENTS][]; allocateNewSegment(); }
public ObjectBigArray(Object initialValue) { this.initialValue = initialValue; array = new Object[INITIAL_SEGMENTS][]; allocateNewSegment(); }
private void grow(long length) { // how many segments are required to get to the length? int requiredSegments = segment(length) + 1; // grow base array if necessary if (array.length < requiredSegments) { array = Arrays.copyOf(array, requiredSegments); } // add new segments while (segments < requiredSegments) { allocateNewSegment(); } }
private void grow(long length) { // how many segments are required to get to the length? int requiredSegments = segment(length) + 1; // grow base array if necessary if (array.length < requiredSegments) { array = Arrays.copyOf(array, requiredSegments); } // add new segments while (segments < requiredSegments) { allocateNewSegment(); } }