/** * Method that tries to append an entry in buffer if there is enough room; * if there is, entry is appended and 'true' returned; otherwise no changes * are made and 'false' is returned. */ public abstract boolean tryAppendEntry(long[] data, int dataOffset, int dataLength);
/** * Method that tries to append an entry in buffer if there is enough room; * if there is, entry is appended and 'true' returned; otherwise no changes * are made and 'false' is returned. */ public abstract boolean tryAppendEntry(long[] data, int dataOffset, int dataLength);
/** * Method that tries to append an entry in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void appendEntry(long[] data, int dataOffset, int dataLength) { if (!tryAppendEntry(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 an entry in buffer and returning; * if there is no room, a {@link IllegalStateException} is thrown. */ public final void appendEntry(long[] data, int dataOffset, int dataLength) { if (!tryAppendEntry(data, dataOffset, dataLength)) { throw new IllegalStateException("Not enough room in buffer to append entry of "+dataLength +" (can't allocate enough new segments)"); } }