com.aelitis.azureus.core.diskmanager.file.impl
Class FMFileAccessCompact

java.lang.Object
  extended by com.aelitis.azureus.core.diskmanager.file.impl.FMFileAccessCompact
All Implemented Interfaces:
FMFileAccess

public class FMFileAccessCompact
extends java.lang.Object
implements FMFileAccess


Constructor Summary
protected FMFileAccessCompact(TOTorrentFile _torrent_file, java.io.File _controlFileDir, java.lang.String _controlFileName, FMFileAccess _delegate)
           
 
Method Summary
 void aboutToOpen()
           
 void flush()
           
 FMFileImpl getFile()
           
protected  long getFirstPieceLength()
           
protected  long getFirstPieceStart()
           
protected  long getLastPieceLength()
           
protected  long getLastPieceStart()
           
 long getLength(java.io.RandomAccessFile raf)
           
 java.lang.String getString()
           
 boolean isPieceCompleteProcessingNeeded(int piece_number)
           
 void read(java.io.RandomAccessFile raf, DirectByteBuffer[] buffers, long position)
           
protected  void read(java.io.RandomAccessFile raf, DirectByteBuffer buffer, long position)
           
protected  void readState()
           
 void setLength(java.io.RandomAccessFile raf, long length)
           
 void setPieceComplete(java.io.RandomAccessFile raf, int piece_number, DirectByteBuffer piece_data)
           
 void write(java.io.RandomAccessFile raf, DirectByteBuffer[] buffers, long position)
           
protected  void write(java.io.RandomAccessFile raf, DirectByteBuffer buffer, long position)
           
protected  void writeState()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FMFileAccessCompact

protected FMFileAccessCompact(TOTorrentFile _torrent_file,
                              java.io.File _controlFileDir,
                              java.lang.String _controlFileName,
                              FMFileAccess _delegate)
                       throws FMFileManagerException
Throws:
FMFileManagerException
Method Detail

getFirstPieceStart

protected long getFirstPieceStart()

getFirstPieceLength

protected long getFirstPieceLength()

getLastPieceStart

protected long getLastPieceStart()

getLastPieceLength

protected long getLastPieceLength()

aboutToOpen

public void aboutToOpen()
                 throws FMFileManagerException
Specified by:
aboutToOpen in interface FMFileAccess
Throws:
FMFileManagerException

getLength

public long getLength(java.io.RandomAccessFile raf)
               throws FMFileManagerException
Specified by:
getLength in interface FMFileAccess
Throws:
FMFileManagerException

setLength

public void setLength(java.io.RandomAccessFile raf,
                      long length)
               throws FMFileManagerException
Specified by:
setLength in interface FMFileAccess
Throws:
FMFileManagerException

read

protected void read(java.io.RandomAccessFile raf,
                    DirectByteBuffer buffer,
                    long position)
             throws FMFileManagerException
Throws:
FMFileManagerException

read

public void read(java.io.RandomAccessFile raf,
                 DirectByteBuffer[] buffers,
                 long position)
          throws FMFileManagerException
Specified by:
read in interface FMFileAccess
Throws:
FMFileManagerException

write

protected void write(java.io.RandomAccessFile raf,
                     DirectByteBuffer buffer,
                     long position)
              throws FMFileManagerException
Throws:
FMFileManagerException

write

public void write(java.io.RandomAccessFile raf,
                  DirectByteBuffer[] buffers,
                  long position)
           throws FMFileManagerException
Specified by:
write in interface FMFileAccess
Throws:
FMFileManagerException

flush

public void flush()
           throws FMFileManagerException
Specified by:
flush in interface FMFileAccess
Throws:
FMFileManagerException

isPieceCompleteProcessingNeeded

public boolean isPieceCompleteProcessingNeeded(int piece_number)
Specified by:
isPieceCompleteProcessingNeeded in interface FMFileAccess

setPieceComplete

public void setPieceComplete(java.io.RandomAccessFile raf,
                             int piece_number,
                             DirectByteBuffer piece_data)
                      throws FMFileManagerException
Specified by:
setPieceComplete in interface FMFileAccess
Throws:
FMFileManagerException

readState

protected void readState()
                  throws FMFileManagerException
Throws:
FMFileManagerException

writeState

protected void writeState()
                   throws FMFileManagerException
Throws:
FMFileManagerException

getFile

public FMFileImpl getFile()
Specified by:
getFile in interface FMFileAccess

getString

public java.lang.String getString()
Specified by:
getString in interface FMFileAccess