// and store in textRecords object.
for (int i = 0; i < textRecCount; i++) {
System.arraycopy(textBytes, pos, recBytes, 0, recBytes.length);
pos += recBytes.length;
Record zRec = new Record(recBytes);
textRecords.add(zRec);
}
// there's more if ...
if (pos < textLen) {
textRecCount++;
recBytes = new byte[textLen - pos];
System.arraycopy(textBytes, pos, recBytes, 0, recBytes.length);
Record rec = new Record(recBytes);
textRecords.add(rec);
}
// construct the Record array and copy
// references from textRecords.
Record[] allRecords = new Record[textRecords.size() + 1];
allRecords[0] = new Record(getHeaderBytes());
for (int i = 1; i < allRecords.length; i++) {
allRecords[i] = (Record) textRecords.get(i-1);
}