com.mmbreakfast.unlod.lod
Class LodFile

java.lang.Object
  extended bycom.mmbreakfast.unlod.lod.LodFile
Direct Known Subclasses:
EnglishDLodFile, MM6LodFile, MM6NewLodFile, MM6SndFile, MM6SpritesLodFile, MM6VidFile, MM7NewLodFile

public abstract class LodFile
extends Object


Field Summary
protected  HashMap entries
           
protected static Class[] ENTRY_CONSTRUCTOR
           
protected  File file
           
protected static long FILE_HEADER_SIZE_OFFSET
           
protected static long FILE_SIZE_MINUS_FILE_HEADER_SIZE_OFFSET
           
protected  byte[] fileHeader
           
protected  RandomAccessFileInputStream in
           
protected  List orderedEntries
           
 
Constructor Summary
protected LodFile(File file, RandomAccessFileInputStream inputStream)
           
 
Method Summary
private  LodResource findFileBasedModifiedLodResource(List modifiedFileList, LodEntry lodEntry)
           
 LodEntry findLodEntryByFileName(String string)
           
 LodEntry findLodEntryForFile(File file)
           
abstract  long getEntriesNumberOffset()
           
abstract  Class getEntryClass()
           
abstract  long getEntryHeaderLength()
           
 File getFile()
           
 byte[] getFileHeader()
           
protected  long getFileHeaderSizeOffset()
           
 String getFileName()
           
protected  long getFileSizeMinusFileHeaderSizeOffset()
           
abstract  long getHeaderOffset()
           
 Map getLodEntries()
           
protected  LodEntry getNextEntry(int entriesSoFar, RandomAccessFile raf)
           
 RandomAccessFileInputStream getRandomAccessFileInputStream()
           
protected  void readEntries(RandomAccessFile raf, long entryCount)
           
protected  long readEntryCount(RandomAccessFile raf)
           
protected  byte[] readFileHeader(RandomAccessFile raf)
           
 void updateByAppendingData(TaskObserver taskObserver, RandomAccessFile randomAccessFile, LodResource resourceToImport)
           
protected  void verify(RandomAccessFile raf)
           
protected  void verifySignature(RandomAccessFile raf)
           
 void write(TaskObserver taskObserver, RandomAccessFile randomAccessFile, List modifiedFileList, LodResource resourceToImport)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTRY_CONSTRUCTOR

protected static final Class[] ENTRY_CONSTRUCTOR

file

protected File file

in

protected RandomAccessFileInputStream in

fileHeader

protected byte[] fileHeader

entries

protected HashMap entries

orderedEntries

protected List orderedEntries

FILE_HEADER_SIZE_OFFSET

protected static final long FILE_HEADER_SIZE_OFFSET
See Also:
Constant Field Values

FILE_SIZE_MINUS_FILE_HEADER_SIZE_OFFSET

protected static final long FILE_SIZE_MINUS_FILE_HEADER_SIZE_OFFSET
See Also:
Constant Field Values
Constructor Detail

LodFile

protected LodFile(File file,
                  RandomAccessFileInputStream inputStream)
           throws IOException,
                  InvalidLodFileException
Method Detail

getFile

public File getFile()

getFileName

public String getFileName()

verifySignature

protected void verifySignature(RandomAccessFile raf)
                        throws IOException,
                               InvalidLodFileException
Throws:
IOException
InvalidLodFileException

verify

protected void verify(RandomAccessFile raf)
               throws IOException,
                      InvalidLodFileException
Throws:
IOException
InvalidLodFileException

readFileHeader

protected byte[] readFileHeader(RandomAccessFile raf)
                         throws IOException
Throws:
IOException

readEntryCount

protected long readEntryCount(RandomAccessFile raf)
                       throws IOException,
                              InvalidLodFileException
Throws:
IOException
InvalidLodFileException

readEntries

protected void readEntries(RandomAccessFile raf,
                           long entryCount)
                    throws IOException
Throws:
IOException

findFileBasedModifiedLodResource

private LodResource findFileBasedModifiedLodResource(List modifiedFileList,
                                                     LodEntry lodEntry)

findLodEntryForFile

public LodEntry findLodEntryForFile(File file)

getFileHeader

public byte[] getFileHeader()

getLodEntries

public Map getLodEntries()

findLodEntryByFileName

public LodEntry findLodEntryByFileName(String string)
                                throws NoSuchEntryException
Throws:
NoSuchEntryException

getNextEntry

protected LodEntry getNextEntry(int entriesSoFar,
                                RandomAccessFile raf)
                         throws IOException
Throws:
IOException

write

public void write(TaskObserver taskObserver,
                  RandomAccessFile randomAccessFile,
                  List modifiedFileList,
                  LodResource resourceToImport)
           throws IOException,
                  InterruptedException
Throws:
IOException
InterruptedException

updateByAppendingData

public void updateByAppendingData(TaskObserver taskObserver,
                                  RandomAccessFile randomAccessFile,
                                  LodResource resourceToImport)
                           throws IOException,
                                  InterruptedException
Throws:
IOException
InterruptedException

getRandomAccessFileInputStream

public RandomAccessFileInputStream getRandomAccessFileInputStream()

getFileHeaderSizeOffset

protected long getFileHeaderSizeOffset()

getFileSizeMinusFileHeaderSizeOffset

protected long getFileSizeMinusFileHeaderSizeOffset()

getHeaderOffset

public abstract long getHeaderOffset()

getEntriesNumberOffset

public abstract long getEntriesNumberOffset()

getEntryHeaderLength

public abstract long getEntryHeaderLength()

getEntryClass

public abstract Class getEntryClass()