|
||||||||||
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--ifc.bim.openecg.jtools.jparser.SectGen
The structure of a generic section, with methods to load header and data part from a file
| Field Summary | |
byte[] |
data
Stores the section's data part |
SectHeader |
head
Stores the section's header |
int |
indx
The start index for reading operations |
java.util.logging.Logger |
log
Log error and info messages produced during the section's load operation |
| Constructor Summary | |
SectGen()
Constructs a SectGen with an anonymous logger |
|
SectGen(java.util.logging.Logger log)
Constructs a SectGen that uses a specific logger |
|
| Method Summary | |
void |
Load(javax.imageio.stream.FileImageOutputStream fHandle,
int idx)
Retrieves the header and data part of the section from the specified FileImageOutputStream starting at index "idx" and stores them in the "head" and "data" variables. |
void |
Parse(int lNum)
An empty method to be overridden by classes that extends this one. |
void |
PrnInfo()
An empty method to be overridden by classes that extends this one. |
byte |
readByte()
Reads a byte from "data" starting at index "indx", and returns it as a byte value. |
void |
readFully(byte[] dest)
Reads "dest.len" bytes from "data" starting at index "idx", and stores them into "dest". |
int |
readInt()
Reads four bytes from "data" starting at index "indx", and (conceptually) concatenates them according to Little Endian byte order, and returns the result as an int value. |
short |
readShort()
Reads two bytes from "data" starting at index "indx", and (conceptually) concatenates them according to Little Endian byte order, and returns the result as a short value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public SectHeader head
public byte[] data
public java.util.logging.Logger log
public int indx
| Constructor Detail |
public SectGen()
public SectGen(java.util.logging.Logger log)
log - the logger to be used| Method Detail |
public byte readByte()
java.lang.IndexOutOfBoundsException - if the index "idx" is greater tha the array length.public short readShort()
java.lang.IndexOutOfBoundsException - if the end of the array is reached before all bytes are read.public int readInt()
java.lang.IndexOutOfBoundsException - if the end of the array is reached before all bytes are read.public void readFully(byte[] dest)
dest - an array of bytes
java.lang.IndexOutOfBoundsException - if the stream reaches the end before reading all the bytes.
Bytes already read are stored anyway.
public void Load(javax.imageio.stream.FileImageOutputStream fHandle,
int idx)
throws java.lang.Exception
fHandle - a FileImageInputStream pointing at the source fileidx - an int representing the index of the first byte of the section in the source file.
java.lang.Exception - if the operation fails
public void Parse(int lNum)
throws java.lang.Exception
lNum - total number of leads stored in the SCP-ECG record (irrilevant for some sections)
java.lang.Exception - if any error occurspublic void PrnInfo()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||