org.free.garminimg
Class ImgSubFile
java.lang.Object
org.free.garminimg.ImgSubFile
- Direct Known Subclasses:
- TreSubFile, UnknownSubFile
public abstract class ImgSubFile
- extends java.lang.Object
One sub-file within a .img file.
Constructor Summary |
ImgSubFile(java.lang.String filename,
java.lang.String filetype,
int fileSize,
int blocSize,
ImgFileBag fileBag)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
headerLength
protected int headerLength
fileBag
protected ImgFileBag fileBag
ImgSubFile
public ImgSubFile(java.lang.String filename,
java.lang.String filetype,
int fileSize,
int blocSize,
ImgFileBag fileBag)
create
public static ImgSubFile create(java.lang.String filename,
java.lang.String filetype,
int fileSize,
int blocSize,
ImgFileBag fileBag)
init
public abstract void init()
throws java.io.IOException
- Throws:
java.io.IOException
superInit
protected void superInit(ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
getLockedPos
public long getLockedPos()
- Returns:
- Position of the locked byte relative to the start of the sub-file.
addBloc
public void addBloc(long bloc)
getFilename
public java.lang.String getFilename()
getFileSize
public int getFileSize()
getFiletype
public java.lang.String getFiletype()
getHeaderLength
protected int getHeaderLength()
getLocked
public int getLocked()
getAbsolutePosition
public long getAbsolutePosition(long relative)
throws java.io.EOFException
- Parameters:
relative
- The position relative to the start of the sub-file
- Returns:
- The position relative to the start of the IMG file.
- Throws:
java.io.EOFException
seek
public void seek(long pos,
ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
getNextReadPos
public long getNextReadPos(ImgSubFile.FileContext context)
readByte
public int readByte(ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
readString
public java.lang.String readString(int len,
ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
readUInt16
public int readUInt16(ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
readUInt24
public int readUInt24(ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
readUInt32
public long readUInt32(ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
readInt16
public int readInt16(ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
readInt24
public int readInt24(ImgSubFile.FileContext context)
throws java.io.IOException
- Throws:
java.io.IOException
printDebug
public void printDebug(java.io.PrintStream out)
throws java.io.IOException
- Throws:
java.io.IOException
debugPrintHex
public void debugPrintHex(ImgSubFile.FileContext context,
long startOffset,
long length)
throws java.io.IOException
- Throws:
java.io.IOException
Copyright © 2008. All Rights Reserved.