Class FMFileAccessLinear
- java.lang.Object
-
- com.biglybt.core.diskmanager.file.impl.FMFileAccessLinear
-
- All Implemented Interfaces:
FMFileAccess
public class FMFileAccessLinear extends java.lang.Object implements FMFileAccess
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.biglybt.core.diskmanager.file.impl.FMFileAccess
FMFileAccess.FileAccessor
-
-
Field Summary
Fields Modifier and Type Field Description private static boolean
DEBUG
private static boolean
DEBUG_VERBOSE
private FMFileImpl
owner
private static int
READ_RETRY_DELAY
private static int
READ_RETRY_LIMIT
private static boolean
USE_MMAP
private static int
WRITE_RETRY_DELAY
private static int
WRITE_RETRY_LIMIT
-
Constructor Summary
Constructors Modifier Constructor Description protected
FMFileAccessLinear(FMFileImpl _owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
aboutToOpen()
void
flush()
FMFileImpl
getFile()
long
getLength(FMFileAccess.FileAccessor fa)
java.lang.String
getString()
boolean
isPieceCompleteProcessingNeeded(int piece_number)
void
read(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long offset)
void
read(FMFileAccess.FileAccessor fa, DirectByteBuffer buffer, long offset)
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)
-
-
-
Field Detail
-
WRITE_RETRY_LIMIT
private static final int WRITE_RETRY_LIMIT
- See Also:
- Constant Field Values
-
WRITE_RETRY_DELAY
private static final int WRITE_RETRY_DELAY
- See Also:
- Constant Field Values
-
READ_RETRY_LIMIT
private static final int READ_RETRY_LIMIT
- See Also:
- Constant Field Values
-
READ_RETRY_DELAY
private static final int READ_RETRY_DELAY
- See Also:
- Constant Field Values
-
DEBUG
private static final boolean DEBUG
- See Also:
- Constant Field Values
-
DEBUG_VERBOSE
private static final boolean DEBUG_VERBOSE
- See Also:
- Constant Field Values
-
USE_MMAP
private static final boolean USE_MMAP
-
owner
private final FMFileImpl owner
-
-
Constructor Detail
-
FMFileAccessLinear
protected FMFileAccessLinear(FMFileImpl _owner)
-
-
Method Detail
-
aboutToOpen
public void aboutToOpen() throws FMFileManagerException
- Specified by:
aboutToOpen
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
getLength
public long getLength(FMFileAccess.FileAccessor fa) throws FMFileManagerException
- Specified by:
getLength
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
setLength
public void setLength(FMFileAccess.FileAccessor fa, long length) throws FMFileManagerException
- Specified by:
setLength
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
-
read
public void read(FMFileAccess.FileAccessor fa, DirectByteBuffer buffer, long offset) throws FMFileManagerException
- Throws:
FMFileManagerException
-
read
public void read(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long offset) throws FMFileManagerException
- Specified by:
read
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
write
public void write(FMFileAccess.FileAccessor fa, DirectByteBuffer[] buffers, long position) throws FMFileManagerException
- Specified by:
write
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
flush
public void flush() throws FMFileManagerException
- Specified by:
flush
in interfaceFMFileAccess
- Throws:
FMFileManagerException
-
getFile
public FMFileImpl getFile()
- Specified by:
getFile
in interfaceFMFileAccess
-
getString
public java.lang.String getString()
- Specified by:
getString
in interfaceFMFileAccess
-
-