I'm trying to read in a .csv file with 3 shorts in the beginning of the file. I need to read them in and I'm setting to a variable but it seems to not be pulling in the right data.
private short M = 0;
private short rootPtr = 0;
private short N = 0;
RandomAccessFile file;
private short[] TP; // array of TPs for one node
private String[] KV; // array of KVs for one node
private short[] DRP; // array of DRPs for one node
private int nodesRead; // iterator for nodes read
private int sizeOfDataRec; // stores size of data record: (M - 1) * (7) + 2
// sets values from header record
file.seek(0);
M = file.readShort();
rootPtr = file.readShort();
N = file.readShort();
sizeOfDataRec = (M - 1) * (7) + 2; // sets size of data record
TP = new short[M];
KV = new String[M - 1];
DRP = new short[M - 1];
The first 3 shorts of the file should be 05,11,22 but I get 12344 when I print out M at the end of this bit