Trim the sequence's tail, if it is longer than a determined size

@param maxSize - Maximum size allowed
173125
public void trimSequenceTail(int maxSize) {
        // Trim sequence and quality strings
        this.setSeq(this.sequence.substring(0, maxSize));
        this.setQuality(this.quality.substring(0, maxSize));
    }
895069
public void remove( int first , int last ) {
		if( last < first )
			throw new IllegalArgumentException("first <= last");
		if( last >= size )
			throw new IllegalArgumentException("last must be less than the max size");

		int delta = last-first+1;
		for( int i = last+1; i < size; i++ ) {
			data[i-delta] = data[i];
		}
		size -= delta;
	}
288811
public int skip(int maxSize) {
		int s = maxSize;
		while (hasRemaining()) {
			ByteBuf buf = bufs[first];
			int remaining = buf.readRemaining();
			if (s < remaining) {
				buf.moveHead(s);
				return maxSize;
			} else {
				buf.recycle();
				first = next(first);
				s -= remaining;
			}
		}
		return maxSize - s;
	}
693224
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563")
  public CallOptions withMaxInboundMessageSize(int maxSize) {
    checkArgument(maxSize >= 0, "invalid maxsize %s", maxSize);
    CallOptions newOptions = new CallOptions(this);
    newOptions.maxInboundMessageSize = maxSize;
    return newOptions;
  }
47909
protected final void resize(int requiredSize) {
    // Double until 64, then increase by 50% each time.
    int newCapacity = ((queue.length < 64) ? ((queue.length + 1) << 1) : ((queue.length >> 1) + queue.length));
    // overflow?
    if(newCapacity < 0) {
      throw new OutOfMemoryError();
    }
    if(requiredSize > newCapacity) {
      newCapacity = requiredSize;
    }
    queue = Arrays.copyOf(queue, newCapacity);
  }
1287726
private int cleanupSegmentsToMaintainSize(final Log log) throws IOException {
        if (logRetentionSize < 0 || log.size() < logRetentionSize) return 0;

        List<LogSegment> toBeDeleted = log.markDeletedWhile(new LogSegmentFilter() {

            long diff = log.size() - logRetentionSize;

            public boolean filter(LogSegment segment) {
                diff -= segment.size();
                return diff >= 0;
            }
        });
        return deleteSegments(log, toBeDeleted);
    }
461821
public Cell<C,T> maxSize (Value<C,T> size) {
		maxWidth = size;
		maxHeight = size;
		return this;
	}
46315
def maxsize(self, size):
        """"""
        if size < 0:
            raise ValueError('maxsize must be non-negative')
        with self._lock:
            self._enforce_size_limit(size)
            self._maxsize = size
611694
public void setMaxImageWidth(String maxImageWidth) {
        try {
            if (Integer.parseInt(maxImageWidth) > 0) {
                this.maxImageWidth = maxImageWidth;
            }
        } catch (NumberFormatException ex) {
            LOGGER.info(String.format("You are trying to parse '%s' as a number for maxImageWidth.", maxImageWidth));
        }
    }
594819
public void removeMax() {
		Node<RedBlackTreeLong<T>> e = ranges.getMax();
		e.getElement().removeMax();
		if (e.getElement().isEmpty())
			ranges.removeInstance(e.getValue(), e.getElement());
		size--;
	}
587562
public static String cutBegin(String data, int maxLength) {
        if (data.length() > maxLength) {
            return "..." + data.substring(data.length() - maxLength, data.length());
        } else {
            return data;
        }
    }
665174
@GuardedBy("evictionLock")
  void setMaximumSize(long maximum) {
    requireArgument(maximum >= 0);
    if (maximum == maximum()) {
      return;
    }

    long max = Math.min(maximum, MAXIMUM_CAPACITY);
    long window = max - (long) (PERCENT_MAIN * max);
    long mainProtected = (long) (PERCENT_MAIN_PROTECTED * (max - window));

    setMaximum(max);
    setWindowMaximum(window);
    setMainProtectedMaximum(mainProtected);

    setHitsInSample(0);
    setMissesInSample(0);
    setStepSize(-HILL_CLIMBER_STEP_PERCENT * max);

    if ((frequencySketch() != null) && !isWeighted() && (weightedSize() >= (max >>> 1))) {
      // Lazily initialize when close to the maximum size
      frequencySketch().ensureCapacity(max);
    }
  }
489962
function truncate(str, maxLength) {
	maxLength = maxLength || 300;

	if (str.length > maxLength) {
		var index = str.indexOf('>');
		str = str.substring(0, index + 1);
	}

	return str;
}
104207
private int rangeLimit(int size, int min, int max) {
        if (size < min) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Config: " + size + " too small");
            }
            return min;
        } else if (size > max) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Config: " + size + " too large");
            }
            return max;
        }
        return size;
    }
1300323
public static Validation<String> length(int minSize, int maxSize) {
        return moreThan(minSize).and(lessThan(maxSize));
    }
1288730
protected List<CmsResource> shrinkToFit(List<CmsResource> result, int maxSize) {

        if ((maxSize > 0) && (result.size() > maxSize)) {
            // cut off all items > count
            result = result.subList(0, maxSize);
        }

        return result;
    }
98166
public void setMaxTokenLength(int maxTokenLength)
    {
        if(maxTokenLength < 1)
            throw new IllegalArgumentException("Max token length must be positive, not " + maxTokenLength);
        if(maxTokenLength <= minTokenLength)
            throw new IllegalArgumentException("Max token length must be larger than the min token length");
        this.maxTokenLength = maxTokenLength;
    }