Class FileInfo


  • public class FileInfo
    extends Object
    • Field Detail

      • fileLock

        public final Object fileLock
        A lock to prevent concurrent writes to a single file
    • Constructor Detail

      • FileInfo

        public FileInfo​(long filesize,
                        long firstByteOffset,
                        File file,
                        int pieceCount)
    • Method Detail

      • getPieceCount

        public int getPieceCount()
        The amount of pieces which contain a part of data for this file
        Returns:
        the amount of pieces for this file
      • getSize

        public long getSize()
        Gets the size of this file
        Returns:
        The size of this file.
      • getFirstByteOffset

        public long getFirstByteOffset()
        The offset of the first byte as if the entire torrent is a single file
        Returns:
        the first byte offset
      • getFileName

        public String getFileName()
        Gets the name of this file.
        Returns:
        The name of this file.
      • getFileAccess

        public RandomAccessFile getFileAccess()
        Gets the handle to write/read from this file.
        Returns:
        The IO handle.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object