/** * Method that tries to append data in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void append(long[] data) { append(data, 0, data.length); }
public final int read(long[] buffer) throws InterruptedException { return read(buffer, 0, buffer.length); }
public final int readIfAvailable(long[] buffer) { return readIfAvailable(buffer, 0, buffer.length); }
/** * Method that tries to append data in buffer if there is enough room; * if there is, data appended and 'true' returned; otherwise no changes * are made and 'false' is returned. */ public abstract boolean tryAppend(long[] data, int dataOffset, int dataLength);
/** * Method that tries to append data in buffer if there is enough room; * if there is, data appended and 'true' returned; otherwise no changes * are made and 'false' is returned. */ public abstract boolean tryAppend(long[] data, int dataOffset, int dataLength);
/** * Method that tries to append data in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void append(long[] data, int dataOffset, int dataLength) { if (!tryAppend(data, dataOffset, dataLength)) { throw new IllegalStateException("Not enough room in buffer to append entry of "+dataLength +" (can't allocate enough new segments)"); } }
/** * Method that tries to append data in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void append(long[] data) { append(data, 0, data.length); }
public final int read(long[] buffer) throws InterruptedException { return read(buffer, 0, buffer.length); }
public final int readIfAvailable(long[] buffer) { return readIfAvailable(buffer, 0, buffer.length); }
/** * Method that tries to append value in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void append(long value) { if (!tryAppend(value)) { throw new IllegalStateException("Not enough room in buffer to append a single value (can't allocate enough new segments)"); } }
/** * Method that tries to append value in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void append(long value) { if (!tryAppend(value)) { throw new IllegalStateException("Not enough room in buffer to append a single value (can't allocate enough new segments)"); } }
/** * Method that tries to append data in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void append(long[] data, int dataOffset, int dataLength) { if (!tryAppend(data, dataOffset, dataLength)) { throw new IllegalStateException("Not enough room in buffer to append entry of "+dataLength +" (can't allocate enough new segments)"); } }