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 com.biglybt.core.diskmanager.file.impl.FMFileAccess
FMFileAccess.FileAccessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final File
private final String
private long
private final FMFileAccess
private long
private long
private long
private long
private static final byte
private final boolean
private static final long
private boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
FMFileAccessCompact
(TOTorrentFile torrent_file, File _controlFileDir, String _controlFileName, FMFileAccess _delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
flush()
getFile()
protected long
protected long
protected long
protected long
long
protected static boolean
isCompact
(FMFileImpl file, TOTorrentFile torrent_file, File control_dir, String control_file_name, int target_type) boolean
isPieceCompleteProcessingNeeded
(int piece_number) void
read
(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) protected void
read
(FMFileAccess.FileAccessor fa, DirectByteBuffer buffer, long position) private void
void
setLength
(FMFileAccess.FileAccessor fa, long length) void
setPieceComplete
(FMFileAccess.FileAccessor fa, int piece_number, DirectByteBuffer piece_data) void
write
(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) protected void
write
(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:
aboutToOpen
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
getLength
- Specified by:
getLength
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
setLength
- Specified by:
setLength
in 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:
read
in 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:
write
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
flush
- Specified by:
flush
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
isPieceCompleteProcessingNeeded
public boolean isPieceCompleteProcessingNeeded(int piece_number) - Specified by:
isPieceCompleteProcessingNeeded
in interfaceFMFileAccess
-
setPieceComplete
public void setPieceComplete(FMFileAccess.FileAccessor fa, int piece_number, DirectByteBuffer piece_data) throws FMFileManagerException - Specified by:
setPieceComplete
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
readState
- Throws:
FMFileManagerException
-
writeState
- Throws:
FMFileManagerException
-
getFile
- Specified by:
getFile
in interfaceFMFileAccess
-
getString
- Specified by:
getString
in interfaceFMFileAccess
-