jAER project on SourceForge

net.sf.jaer.util
Class HexFileParser

java.lang.Object
  extended by net.sf.jaer.util.HexFileParser

public class HexFileParser
extends java.lang.Object

Opens and parses Intel HEX format files for device download.


Nested Class Summary
 class HexFileParser.Record
           
 
Field Summary
static byte DATA_RECORD
           
static byte EOF_RECORD
           
static int MAX_CODE_LENGTH
          you have to specify the required MAX_CODE_LENGTH
static int RADIX
           
 java.util.ArrayList<HexFileParser.Record> records
           
 
Constructor Summary
HexFileParser(java.io.File resourcePath)
          Constructs a CustomFileReader object.
HexFileParser(java.lang.String resourcePath)
          Constructs a CustomFileReader object.
 
Method Summary
 java.util.ArrayList<HexFileParser.Record> getRecords()
           
static void main(java.lang.String[] args)
           
 byte[] parseFile()
          parses the hexfile and returns an array of bytes that actually contain that would be burnt into the target device.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CODE_LENGTH

public static final int MAX_CODE_LENGTH
you have to specify the required MAX_CODE_LENGTH

See Also:
Constant Field Values

RADIX

public static final int RADIX
See Also:
Constant Field Values

DATA_RECORD

public static final byte DATA_RECORD
See Also:
Constant Field Values

EOF_RECORD

public static final byte EOF_RECORD
See Also:
Constant Field Values

records

public java.util.ArrayList<HexFileParser.Record> records
Constructor Detail

HexFileParser

public HexFileParser(java.lang.String resourcePath)
              throws java.io.FileNotFoundException,
                     java.io.IOException
Constructs a CustomFileReader object.

Parameters:
resourcePath - intel hex file as resource or file with full pathname. This filename is a full pathname giving the location of the file somewhere in the classpath (e.g. in the jar of the project) or in the filesystem. The classpath resources are searched first, followed by the filesystem.
Throws:
java.io.FileNotFoundException - If the file can't be found
java.io.IOException

HexFileParser

public HexFileParser(java.io.File resourcePath)
              throws java.io.FileNotFoundException,
                     java.io.IOException
Constructs a CustomFileReader object.

Parameters:
resourcePath - intel hex file as resource. This filename is a full pathname giving the location of the file somewhere in the classpath (e.g. in the jar of the project).
Throws:
java.io.FileNotFoundException - If the file can't be found
java.io.IOException
Method Detail

parseFile

public byte[] parseFile()
                 throws java.io.IOException
parses the hexfile and returns an array of bytes that actually contain that would be burnt into the target device. the position of bytes in the array is determined by the specified address. If an element doesn't have any code specified, it will contain a 0.

Returns:
returns an array of code bytes.
Throws:
java.io.IOException

getRecords

public java.util.ArrayList<HexFileParser.Record> getRecords()

main

public static void main(java.lang.String[] args)

jAER project on SourceForge