private static long mask(int bitsPerValue) { return bitsPerValue == 64 ? ~0L : PackedInts.maxValue(bitsPerValue); }
/** Adds a value to this writer */ public void add(long l) throws IOException { assert bitsPerValue == 64 || (l >= 0 && l <= PackedInts.maxValue(bitsPerValue)) : bitsPerValue; assert !finished; if (count >= numValues) { throw new EOFException("Writing past end of stream"); } nextValues[off++] = l; if (off == nextValues.length) { flush(); } count++; }
/** * Write a value using exactly <code>bitsPerValue</code> bits. */ public void writeLong(long value, int bitsPerValue) throws IOException { assert bitsPerValue == 64 || (value >= 0 && value <= PackedInts.maxValue(bitsPerValue)); while (bitsPerValue > 0) { if (remainingBits == 0) { out.writeByte((byte) current); current = 0L; remainingBits = 8; } final int bits = Math.min(remainingBits, bitsPerValue); current = current | (((value >>> (bitsPerValue - bits)) & ((1L << bits) - 1)) << (remainingBits - bits)); bitsPerValue -= bits; remainingBits -= bits; } }
/** * Fill the mutable from <code>fromIndex</code> (inclusive) to * <code>toIndex</code> (exclusive) with <code>val</code>. */ public void fill(int fromIndex, int toIndex, long val) { assert val <= maxValue(getBitsPerValue()); assert fromIndex <= toIndex; for (int i = fromIndex; i < toIndex; ++i) { set(i, val); } }
} else if (min > 0L) { min = Math.max(0L, max - PackedInts.maxValue(bitsRequired));
private static long mask(int bitsPerValue) { return bitsPerValue == 64 ? ~0L : PackedInts.maxValue(bitsPerValue); }
private static long mask(int bitsPerValue) { return bitsPerValue == 64 ? ~0L : PackedInts.maxValue(bitsPerValue); }
private static long mask(int bitsPerValue) { return bitsPerValue == 64 ? ~0L : PackedInts.maxValue(bitsPerValue); }
/** Adds a value to this writer */ public void add(long l) throws IOException { assert bitsPerValue == 64 || (l >= 0 && l <= PackedInts.maxValue(bitsPerValue)) : bitsPerValue; assert !finished; if (count >= numValues) { throw new EOFException("Writing past end of stream"); } nextValues[off++] = l; if (off == nextValues.length) { flush(); } count++; }
/** Adds a value to this writer */ public void add(long l) throws IOException { assert bitsPerValue == 64 || (l >= 0 && l <= PackedInts.maxValue(bitsPerValue)) : bitsPerValue; assert !finished; if (count >= numValues) { throw new EOFException("Writing past end of stream"); } nextValues[off++] = l; if (off == nextValues.length) { flush(); } count++; }
/** Adds a value to this writer */ public void add(long l) throws IOException { assert bitsPerValue == 64 || (l >= 0 && l <= PackedInts.maxValue(bitsPerValue)) : bitsPerValue; assert !finished; if (count >= numValues) { throw new EOFException("Writing past end of stream"); } nextValues[off++] = l; if (off == nextValues.length) { flush(); } count++; }
/** * Write a value using exactly <code>bitsPerValue</code> bits. */ public void writeLong(long value, int bitsPerValue) throws IOException { assert bitsPerValue == 64 || (value >= 0 && value <= PackedInts.maxValue(bitsPerValue)); while (bitsPerValue > 0) { if (remainingBits == 0) { out.writeByte((byte) current); current = 0L; remainingBits = 8; } final int bits = Math.min(remainingBits, bitsPerValue); current = current | (((value >>> (bitsPerValue - bits)) & ((1L << bits) - 1)) << (remainingBits - bits)); bitsPerValue -= bits; remainingBits -= bits; } }
/** * Write a value using exactly <code>bitsPerValue</code> bits. */ public void writeLong(long value, int bitsPerValue) throws IOException { assert bitsPerValue == 64 || (value >= 0 && value <= PackedInts.maxValue(bitsPerValue)); while (bitsPerValue > 0) { if (remainingBits == 0) { out.writeByte((byte) current); current = 0L; remainingBits = 8; } final int bits = Math.min(remainingBits, bitsPerValue); current = current | (((value >>> (bitsPerValue - bits)) & ((1L << bits) - 1)) << (remainingBits - bits)); bitsPerValue -= bits; remainingBits -= bits; } }
/** * Write a value using exactly <code>bitsPerValue</code> bits. */ public void writeLong(long value, int bitsPerValue) throws IOException { assert bitsPerValue == 64 || (value >= 0 && value <= PackedInts.maxValue(bitsPerValue)); while (bitsPerValue > 0) { if (remainingBits == 0) { out.writeByte((byte) current); current = 0L; remainingBits = 8; } final int bits = Math.min(remainingBits, bitsPerValue); current = current | (((value >>> (bitsPerValue - bits)) & ((1L << bits) - 1)) << (remainingBits - bits)); bitsPerValue -= bits; remainingBits -= bits; } }
/** * Fill the mutable from <code>fromIndex</code> (inclusive) to * <code>toIndex</code> (exclusive) with <code>val</code>. */ public void fill(int fromIndex, int toIndex, long val) { assert val <= maxValue(getBitsPerValue()); assert fromIndex <= toIndex; for (int i = fromIndex; i < toIndex; ++i) { set(i, val); } }
/** * Fill the mutable from <code>fromIndex</code> (inclusive) to * <code>toIndex</code> (exclusive) with <code>val</code>. */ public void fill(int fromIndex, int toIndex, long val) { assert val <= maxValue(getBitsPerValue()); assert fromIndex <= toIndex; for (int i = fromIndex; i < toIndex; ++i) { set(i, val); } }
/** * Fill the mutable from <code>fromIndex</code> (inclusive) to * <code>toIndex</code> (exclusive) with <code>val</code>. */ public void fill(int fromIndex, int toIndex, long val) { assert val <= maxValue(getBitsPerValue()); assert fromIndex <= toIndex; for (int i = fromIndex; i < toIndex; ++i) { set(i, val); } }
} else if (min > 0L) { min = Math.max(0L, max - PackedInts.maxValue(bitsRequired));
} else if (min > 0L) { min = Math.max(0L, max - PackedInts.maxValue(bitsRequired));
} else if (min > 0L) { min = Math.max(0L, max - PackedInts.maxValue(bitsRequired));