public long getTotalBytes() { return in.length(); } }
public long getLengthInBytes() { return dfile.length(); }
public long getLengthInBytes() { return dfile.length(); }
/** * @return true if there is no more data to read */ public boolean isEOF() { return current() == length(); }
/** * @return true if there is no more data to read */ public boolean isEOF() { return current() == length(); }
public long bytesRemaining() { return length() - getFilePointer(); }
public long length() { maybeInit(); return in.length(); } }
/** * @return true if there is no more data to read */ public boolean isEOF() { return current() == length(); }
@Override public void seek(long newPosition) { if (newPosition < 0) throw new IllegalArgumentException("new position should not be negative"); if (newPosition > length()) // it is save to call length() in read-only mode throw new IllegalArgumentException(String.format("unable to seek to position %d in %s (%d bytes) in read-only mode", newPosition, getPath(), length())); current = newPosition; if (newPosition > (bufferOffset + validBufferBytes) || newPosition < bufferOffset) reBuffer(); }
public long length() { maybeInit(); return in.length(); } }
/** * @return true if there is no more data to read */ public boolean isEOF() { return getFilePointer() == length(); }
/** * @return true if there is no more data to read */ public boolean isEOF() { return current() == length(); }
public long length() { maybeInit(); return in.length(); } }
public long bytesRemaining() { return length() - getFilePointer(); }
public long bytesRemaining() { return length() - getFilePointer(); }
public long bytesRemaining() { return length() - getFilePointer(); }
public long bytesRemaining() { return length() - getFilePointer(); }
@SuppressWarnings("resource") public SyncSegment nextSegment(int startPosition, int nextSectionStartPosition) throws IOException { int totalPlainTextLength = reader.readInt(); currentSegmentEndPosition = nextSectionStartPosition - 1; nextLogicalStart += SYNC_MARKER_SIZE; FileDataInput input = new EncryptedFileSegmentInputStream(reader.getPath(), nextLogicalStart, 0, totalPlainTextLength, chunkProvider); nextLogicalStart += totalPlainTextLength; return new SyncSegment(input, startPosition, nextSectionStartPosition, (int)nextLogicalStart, tolerateSegmentErrors(nextSectionStartPosition, reader.length())); } }
@SuppressWarnings("resource") public SyncSegment nextSegment(int startPosition, int nextSectionStartPosition) throws IOException { int totalPlainTextLength = reader.readInt(); currentSegmentEndPosition = nextSectionStartPosition - 1; nextLogicalStart += SYNC_MARKER_SIZE; FileDataInput input = new EncryptedFileSegmentInputStream(reader.getPath(), nextLogicalStart, 0, totalPlainTextLength, chunkProvider); nextLogicalStart += totalPlainTextLength; return new SyncSegment(input, startPosition, nextSectionStartPosition, (int)nextLogicalStart, tolerateSegmentErrors(nextSectionStartPosition, reader.length())); } }
@SuppressWarnings("resource") public SyncSegment nextSegment(int startPosition, int nextSectionStartPosition) throws IOException { int totalPlainTextLength = reader.readInt(); currentSegmentEndPosition = nextSectionStartPosition - 1; nextLogicalStart += SYNC_MARKER_SIZE; FileDataInput input = new EncryptedFileSegmentInputStream(reader.getPath(), nextLogicalStart, 0, totalPlainTextLength, chunkProvider); nextLogicalStart += totalPlainTextLength; return new SyncSegment(input, startPosition, nextSectionStartPosition, (int)nextLogicalStart, tolerateSegmentErrors(nextSectionStartPosition, reader.length())); } }