/** * Read data from file starting from current currentOffset to populate buffer. */ public void reBuffer() { if (isEOF()) return; reBufferAt(current()); }
/** * Read data from file starting from current currentOffset to populate buffer. */ public void reBuffer() { if (isEOF()) return; reBufferAt(current()); }
/** * Read data from file starting from current currentOffset to populate buffer. */ public void reBuffer() { if (isEOF()) return; reBufferAt(current()); }
/** * Read data from file starting from current currentOffset to populate buffer. */ public void reBuffer() { if (isEOF()) return; reBufferAt(current()); }
@Override public void seek(long newPosition) { if (newPosition < 0) throw new IllegalArgumentException("new position should not be negative"); if (buffer == null) throw new IllegalStateException("Attempted to seek in a closed RAR"); long bufferOffset = bufferHolder.offset(); if (newPosition >= bufferOffset && newPosition < bufferOffset + buffer.limit()) { buffer.position((int) (newPosition - bufferOffset)); return; } if (newPosition > length()) throw new IllegalArgumentException(String.format("Unable to seek to position %d in %s (%d bytes) in read-only mode", newPosition, getPath(), length())); reBufferAt(newPosition); }
@Override public void seek(long newPosition) { if (newPosition < 0) throw new IllegalArgumentException("new position should not be negative"); if (buffer == null) throw new IllegalStateException("Attempted to seek in a closed RAR"); long bufferOffset = bufferHolder.offset(); if (newPosition >= bufferOffset && newPosition < bufferOffset + buffer.limit()) { buffer.position((int) (newPosition - bufferOffset)); return; } if (newPosition > length()) throw new IllegalArgumentException(String.format("Unable to seek to position %d in %s (%d bytes) in read-only mode", newPosition, getPath(), length())); reBufferAt(newPosition); }
@Override public void seek(long newPosition) { if (newPosition < 0) throw new IllegalArgumentException("new position should not be negative"); if (buffer == null) throw new IllegalStateException("Attempted to seek in a closed RAR"); long bufferOffset = bufferHolder.offset(); if (newPosition >= bufferOffset && newPosition < bufferOffset + buffer.limit()) { buffer.position((int) (newPosition - bufferOffset)); return; } if (newPosition > length()) throw new IllegalArgumentException(String.format("Unable to seek to position %d in %s (%d bytes) in read-only mode", newPosition, getPath(), length())); reBufferAt(newPosition); }
@Override public void seek(long newPosition) { if (newPosition < 0) throw new IllegalArgumentException("new position should not be negative"); if (buffer == null) throw new IllegalStateException("Attempted to seek in a closed RAR"); long bufferOffset = bufferHolder.offset(); if (newPosition >= bufferOffset && newPosition < bufferOffset + buffer.limit()) { buffer.position((int) (newPosition - bufferOffset)); return; } if (newPosition > length()) throw new IllegalArgumentException(String.format("Unable to seek to position %d in %s (%d bytes) in read-only mode", newPosition, getPath(), length())); reBufferAt(newPosition); }