/** Write a new value. Note that data might not make it to storage until * {@link #finish()} is called. * @throws IllegalArgumentException if values don't come in order */ public void add(long v) throws IOException { if (v < previous) { throw new IllegalArgumentException("Values do not come in order: " + previous + ", " + v); } if (bufferSize == buffer.length) { flush(); } buffer[bufferSize++] = v; previous = v; count++; }
/** This must be called exactly once after all values have been {@link #add(long) added}. */ public void finish() throws IOException { if (count != numValues) { throw new IllegalStateException("Wrong number of values added, expected: " + numValues + ", got: " + count); } if (finished) { throw new IllegalStateException("#finish has been called already"); } if (bufferSize > 0) { flush(); } finished = true; }
/** Write a new value. Note that data might not make it to storage until * {@link #finish()} is called. * @throws IllegalArgumentException if values don't come in order */ public void add(long v) throws IOException { if (v < previous) { throw new IllegalArgumentException("Values do not come in order: " + previous + ", " + v); } if (bufferSize == buffer.length) { flush(); } buffer[bufferSize++] = v; previous = v; count++; }
/** Write a new value. Note that data might not make it to storage until * {@link #finish()} is called. * @throws IllegalArgumentException if values don't come in order */ public void add(long v) throws IOException { if (v < previous) { throw new IllegalArgumentException("Values do not come in order: " + previous + ", " + v); } if (bufferSize == buffer.length) { flush(); } buffer[bufferSize++] = v; previous = v; count++; }
/** Write a new value. Note that data might not make it to storage until * {@link #finish()} is called. * @throws IllegalArgumentException if values don't come in order */ public void add(long v) throws IOException { if (v < previous) { throw new IllegalArgumentException("Values do not come in order: " + previous + ", " + v); } if (bufferSize == buffer.length) { flush(); } buffer[bufferSize++] = v; previous = v; count++; }
/** This must be called exactly once after all values have been {@link #add(long) added}. */ public void finish() throws IOException { if (count != numValues) { throw new IllegalStateException("Wrong number of values added, expected: " + numValues + ", got: " + count); } if (finished) { throw new IllegalStateException("#finish has been called already"); } if (bufferSize > 0) { flush(); } finished = true; }
/** This must be called exactly once after all values have been {@link #add(long) added}. */ public void finish() throws IOException { if (count != numValues) { throw new IllegalStateException("Wrong number of values added, expected: " + numValues + ", got: " + count); } if (finished) { throw new IllegalStateException("#finish has been called already"); } if (bufferSize > 0) { flush(); } finished = true; }
/** This must be called exactly once after all values have been {@link #add(long) added}. */ public void finish() throws IOException { if (count != numValues) { throw new IllegalStateException("Wrong number of values added, expected: " + numValues + ", got: " + count); } if (finished) { throw new IllegalStateException("#finish has been called already"); } if (bufferSize > 0) { flush(); } finished = true; }