Class FMFileAccessCompact
java.lang.Object
com.biglybt.core.diskmanager.file.impl.FMFileAccessCompact
- All Implemented Interfaces:
FMFileAccess
-
Nested Class Summary
Nested classes/interfaces inherited from interface FMFileAccess
FMFileAccess.FileAccessor -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Fileprivate final Stringprivate longprivate final FMFileAccessprivate longprivate longprivate longprivate longprivate static final byteprivate final booleanprivate static final longprivate boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFMFileAccessCompact(TOTorrentFile torrent_file, File _controlFileDir, String _controlFileName, FMFileAccess _delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidflush()getFile()protected longprotected longprotected longprotected longlongprotected static booleanisCompact(FMFileImpl file, TOTorrentFile torrent_file, File control_dir, String control_file_name, int target_type) booleanisPieceCompleteProcessingNeeded(int piece_number) voidread(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) protected voidread(FMFileAccess.FileAccessor fa, DirectByteBuffer buffer, long position) private voidvoidsetLength(FMFileAccess.FileAccessor fa, long length) voidsetPieceComplete(FMFileAccess.FileAccessor fa, int piece_number, DirectByteBuffer piece_data) voidwrite(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) protected voidwrite(FMFileAccess.FileAccessor fa, DirectByteBuffer buffer, long position) protected void
-
Field Details
-
SS
private static final byte SS- See Also:
-
controlFileDir
-
controlFileName
-
delegate
-
current_length_in_state
private volatile long current_length_in_state -
version
private static final long version- See Also:
-
state_required
private final boolean state_required -
write_required
private volatile boolean write_required -
first_piece_start
private long first_piece_start -
first_piece_length
private long first_piece_length -
last_piece_start
private long last_piece_start -
last_piece_length
private long last_piece_length
-
-
Constructor Details
-
FMFileAccessCompact
protected FMFileAccessCompact(TOTorrentFile torrent_file, File _controlFileDir, String _controlFileName, FMFileAccess _delegate) throws FMFileManagerException - Throws:
FMFileManagerException
-
-
Method Details
-
isCompact
protected static boolean isCompact(FMFileImpl file, TOTorrentFile torrent_file, File control_dir, String control_file_name, int target_type) -
getFirstPieceStart
protected long getFirstPieceStart() -
getFirstPieceLength
protected long getFirstPieceLength() -
getLastPieceStart
protected long getLastPieceStart() -
getLastPieceLength
protected long getLastPieceLength() -
aboutToOpen
- Specified by:
aboutToOpenin interfaceFMFileAccess- Throws:
FMFileManagerException
-
getLength
- Specified by:
getLengthin interfaceFMFileAccess- Throws:
FMFileManagerException
-
setLength
- Specified by:
setLengthin interfaceFMFileAccess- Throws:
FMFileManagerException
-
read
protected void read(FMFileAccess.FileAccessor fa, DirectByteBuffer buffer, long position) throws FMFileManagerException - Throws:
FMFileManagerException
-
read
public void read(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) throws FMFileManagerException - Specified by:
readin interfaceFMFileAccess- Throws:
FMFileManagerException
-
write
protected void write(FMFileAccess.FileAccessor fa, DirectByteBuffer buffer, long position) throws FMFileManagerException - Throws:
FMFileManagerException
-
write
public void write(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) throws FMFileManagerException - Specified by:
writein interfaceFMFileAccess- Throws:
FMFileManagerException
-
flush
- Specified by:
flushin interfaceFMFileAccess- Throws:
FMFileManagerException
-
isPieceCompleteProcessingNeeded
public boolean isPieceCompleteProcessingNeeded(int piece_number) - Specified by:
isPieceCompleteProcessingNeededin interfaceFMFileAccess
-
setPieceComplete
public void setPieceComplete(FMFileAccess.FileAccessor fa, int piece_number, DirectByteBuffer piece_data) throws FMFileManagerException - Specified by:
setPieceCompletein interfaceFMFileAccess- Throws:
FMFileManagerException
-
readState
- Throws:
FMFileManagerException
-
writeState
- Throws:
FMFileManagerException
-
getFile
- Specified by:
getFilein interfaceFMFileAccess
-
getString
- Specified by:
getStringin interfaceFMFileAccess
-