@Override public void set(int index, long value) { ensureCapacity(value); current.set(index, value); }
@Override public void fill(int fromIndex, int toIndex, long val) { ensureCapacity(val); current.fill(fromIndex, toIndex, val); }
@Override public int set(int index, long[] arr, int off, int len) { long max = 0; for (int i = off, end = off + len; i < end; ++i) { // bitwise or is nice because either all values are positive and the // or-ed result will require as many bits per value as the max of the // values, or one of them is negative and the result will be negative, // forcing GrowableWriter to use 64 bits per value max |= arr[i]; } ensureCapacity(max); return current.set(index, arr, off, len); }
@Override public void fill(int fromIndex, int toIndex, long val) { ensureCapacity(val); current.fill(fromIndex, toIndex, val); }
@Override public void set(int index, long value) { ensureCapacity(value); current.set(index, value); }
@Override public void fill(int fromIndex, int toIndex, long val) { ensureCapacity(val); current.fill(fromIndex, toIndex, val); }
@Override public void set(int index, long value) { ensureCapacity(value); current.set(index, value); }
@Override public void set(int index, long value) { ensureCapacity(value); current.set(index, value); }
@Override public void fill(int fromIndex, int toIndex, long val) { ensureCapacity(val); current.fill(fromIndex, toIndex, val); }
@Override public int set(int index, long[] arr, int off, int len) { long max = 0; for (int i = off, end = off + len; i < end; ++i) { // bitwise or is nice because either all values are positive and the // or-ed result will require as many bits per value as the max of the // values, or one of them is negative and the result will be negative, // forcing GrowableWriter to use 64 bits per value max |= arr[i]; } ensureCapacity(max); return current.set(index, arr, off, len); }
@Override public int set(int index, long[] arr, int off, int len) { long max = 0; for (int i = off, end = off + len; i < end; ++i) { // bitwise or is nice because either all values are positive and the // or-ed result will require as many bits per value as the max of the // values, or one of them is negative and the result will be negative, // forcing GrowableWriter to use 64 bits per value max |= arr[i]; } ensureCapacity(max); return current.set(index, arr, off, len); }
@Override public int set(int index, long[] arr, int off, int len) { long max = 0; for (int i = off, end = off + len; i < end; ++i) { // bitwise or is nice because either all values are positive and the // or-ed result will require as many bits per value as the max of the // values, or one of them is negative and the result will be negative, // forcing GrowableWriter to use 64 bits per value max |= arr[i]; } ensureCapacity(max); return current.set(index, arr, off, len); }