Package org.johnnei.javatorrent.torrent
Class FileInfo
- java.lang.Object
-
- org.johnnei.javatorrent.torrent.FileInfo
-
public class FileInfo extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)RandomAccessFilegetFileAccess()Gets the handle to write/read from this file.StringgetFileName()Gets the name of this file.longgetFirstByteOffset()The offset of the first byte as if the entire torrent is a single fileintgetPieceCount()The amount of pieces which contain a part of data for this filelonggetSize()Gets the size of this fileinthashCode()StringtoString()
-
-
-
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.
-
-