Example usage for com.google.common.primitives Longs ensureCapacity

List of usage examples for com.google.common.primitives Longs ensureCapacity

Introduction

In this page you can find the example usage for com.google.common.primitives Longs ensureCapacity.

Prototype

public static long[] ensureCapacity(long[] array, int minLength, int padding) 

Source Link

Document

Returns an array containing the same values as array , but guaranteed to be of a specified minimum length.

Usage

From source file:com.lithium.flow.util.Measure.java

public synchronized void addDone(long value) {
    int bin = getBin(System.currentTimeMillis());
    bins = Longs.ensureCapacity(bins, bin + 1, 1024);
    bins[bin] += value;/*from   w ww.j  a v a2s  .  c  o  m*/
    done += value;
}