I am parsing in Java a byte array having the following specification:
Trace data format:
- 4 bytes containing the Id.
- 4 bytes containing the addres
Just to add another possibility for Michael's answer.
Assuming that N
is the same for both fields, and since the same letter is used I would guess that this is the case, the field positions would be like this:
int len = array.length;
int varLen = len - 5*4;
int fieldPos[] = new int[7];
fieldPos[0] = 0;
fieldPos[1] = 4;
fieldPos[2] = 8;
fieldPos[3] = 8 + varLen;
fieldPos[4] = 8 + 2*varLen;
fieldPos[5] = 8 + 2*varLen + 4;
fieldPos[6] = 8 + 2*varLen + 8;