@Override public void add(long l) throws IOException { assert l >= 0; super.add(l); }
/** Append a new long. */ public void add(long l) throws IOException { checkNotFinished(); if (off == values.length) { flush(); } values[off++] = l; ++ord; }
/** * Sole constructor. * @param blockSize the number of values of a single block, must be a multiple of <tt>64</tt> */ public AbstractBlockPackedWriter(DataOutput out, int blockSize) { checkBlockSize(blockSize, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); reset(out); values = new long[blockSize]; }
/** Flush all buffered data to disk. This instance is not usable anymore * after this method has been called until {@link #reset(DataOutput)} has * been called. */ public void finish() throws IOException { checkNotFinished(); if (off > 0) { flush(); } finished = true; }
/** * Sole constructor. * @param blockSize the number of values of a single block, must be a multiple of <tt>64</tt> */ public AbstractBlockPackedWriter(DataOutput out, int blockSize) { checkBlockSize(blockSize, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); reset(out); values = new long[blockSize]; }
@Override public void add(long l) throws IOException { assert l >= 0; super.add(l); }
void addBlockOfZeros() throws IOException { checkNotFinished(); if (off != 0 && off != values.length) { throw new IllegalStateException("" + off); } if (off == values.length) { flush(); } Arrays.fill(values, 0); off = values.length; ord += values.length; }
/** * Sole constructor. * @param blockSize the number of values of a single block, must be a multiple of <tt>64</tt> */ public AbstractBlockPackedWriter(DataOutput out, int blockSize) { checkBlockSize(blockSize, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); reset(out); values = new long[blockSize]; }
@Override public void add(long l) throws IOException { assert l >= 0; super.add(l); }
/** Append a new long. */ public void add(long l) throws IOException { checkNotFinished(); if (off == values.length) { flush(); } values[off++] = l; ++ord; }
/** * Sole constructor. * @param blockSize the number of values of a single block, must be a multiple of <tt>64</tt> */ public AbstractBlockPackedWriter(DataOutput out, int blockSize) { checkBlockSize(blockSize, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); reset(out); values = new long[blockSize]; }
@Override public void add(long l) throws IOException { assert l >= 0; super.add(l); }
/** Append a new long. */ public void add(long l) throws IOException { checkNotFinished(); if (off == values.length) { flush(); } values[off++] = l; ++ord; }
/** Append a new long. */ public void add(long l) throws IOException { checkNotFinished(); if (off == values.length) { flush(); } values[off++] = l; ++ord; }
/** Flush all buffered data to disk. This instance is not usable anymore * after this method has been called until {@link #reset(DataOutput)} has * been called. */ public void finish() throws IOException { checkNotFinished(); if (off > 0) { flush(); } finished = true; }
/** Flush all buffered data to disk. This instance is not usable anymore * after this method has been called until {@link #reset(DataOutput)} has * been called. */ public void finish() throws IOException { checkNotFinished(); if (off > 0) { flush(); } finished = true; }
/** Flush all buffered data to disk. This instance is not usable anymore * after this method has been called until {@link #reset(DataOutput)} has * been called. */ public void finish() throws IOException { checkNotFinished(); if (off > 0) { flush(); } finished = true; }
void addBlockOfZeros() throws IOException { checkNotFinished(); if (off != 0 && off != values.length) { throw new IllegalStateException("" + off); } if (off == values.length) { flush(); } Arrays.fill(values, 0); off = values.length; ord += values.length; }
void addBlockOfZeros() throws IOException { checkNotFinished(); if (off != 0 && off != values.length) { throw new IllegalStateException("" + off); } if (off == values.length) { flush(); } Arrays.fill(values, 0); off = values.length; ord += values.length; }
void addBlockOfZeros() throws IOException { checkNotFinished(); if (off != 0 && off != values.length) { throw new IllegalStateException("" + off); } if (off == values.length) { flush(); } Arrays.fill(values, 0); off = values.length; ord += values.length; }