For this lab you will be creating a file handler for a simple file type.
At the end of this lab it will be possible to STATUS the new file
type and read/write it.
File format:
The file format we will be supporting will be the ORANGE file format
(.orange). ORANGE files hold linearly-sampled data similar to
a Type 1000 BLUE file.
ORANGE files have a 24 byte header followed by the data. All data in the
file is either ScalarLong (SL) or SclarFloat (SF).
The file header contained the following fields:
Byte Offset
Type
Name
Default Value
Description
0
char[6]
Version
"ORANGE"
File version always "ORANGE".
7
char[2]
Format
"SL"
Data format ("SL" or "SF").
8
double
XStart
0.0
X-axis start value.
16
double
XDelta
1.0
X-axis delta value.
Note that char[6] and char[2] reference Strings of length
6 and 2 respectively.
The data portion immediately follows the header (i.e. starting at byte offset 24). The
data portion extends to the end of the file (unlike a BLUE file there is no "extended
header" at the end of the file).
All information in the header, and all of the data is stored using little-endian byte
order (EEEI). (For those unfamilar with byte ordering, think of it as
defining whether you write left-to-right or right-to-left.)