ztex
Class ImgFile

java.lang.Object
  extended by ztex.ImgFile
Direct Known Subclasses:
ZtexImgFile1

public class ImgFile
extends java.lang.Object

A class representing a firmware image.


Field Summary
 short[] data
          This array stores the firmware image.
 boolean isFx3
          Assumed to be an FX3 firmware.
 long startVector
          Start vector.
 
Constructor Summary
ImgFile(java.io.InputStream in, java.lang.String name)
          Constructs an instance from a given file name.
ImgFile(java.lang.String fileName)
          Constructs an instance from a given file name.
 
Method Summary
 void dataInfo(java.io.PrintStream out)
          Print out some information about the memory usage.
static long uncompressAddr(int addr)
          Uncompresses the FX3 address space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

public short[] data
This array stores the firmware image. Values <0 and >255 mean that the data is undefined.


startVector

public long startVector
Start vector. Values <0 mean that no start vector is defined.


isFx3

public boolean isFx3
Assumed to be an FX3 firmware. This value is also set by ZtexImgFile1.

Constructor Detail

ImgFile

public ImgFile(java.io.InputStream in,
               java.lang.String name)
        throws java.io.IOException,
               ImgFileDamagedException
Constructs an instance from a given file name. This method can also read system resources, e.g. files from the current jar archive.

Parameters:
in - Input stream from which the firmware file is read.
name - Name of the input.
Throws:
java.io.IOException - If an read error occurred.
ImgFileDamagedException - If the firmware file is damaged.

ImgFile

public ImgFile(java.lang.String fileName)
        throws java.io.IOException,
               ImgFileDamagedException
Constructs an instance from a given file name. This method can also read system resources, e.g. files from the current jar archive.

Parameters:
fileName - The file name.
Throws:
java.io.IOException - If an read error occurred.
ImgFileDamagedException - If the firmware image file is damaged.
Method Detail

uncompressAddr

public static final long uncompressAddr(int addr)
Uncompresses the FX3 address space.

Parameters:
addr - Compressed address
Returns:
Uncompressed address.

dataInfo

public void dataInfo(java.io.PrintStream out)
Print out some information about the memory usage.

Parameters:
out - Where the data is printed out.