I used the Assembler Record Generator to create a large package which includes most of the SMF records. But I had a problem accessing the fields. This was due to my ignorance. My first try looked like:
Code: Select all
byte[] buffer=new byte[32768];
Smf.BaseRecord baseRecord=new Smf.BaseRecord(buffer);
for(;;) {
bytes_read=vbsinfile.read(buffer,4);
if (bytes_read=-1) then break;
int record_number=baseRecord.getBaseRecord_Rty();
RecordNumber[record_number]++;
}
This did not work. My problem turned out that I thought that when I changed the contents of the buffer, that the contents of the baseRecord also changed. I found that I had to change the above code to:
Code: Select all
byte[] buffer=new byte[32768];
for(;;) {
bytes_read=vbsinfile.read(buffer,4);
if (bytes_read=-1) then break;
Smf.BaseRecord baseRecord=new Smf.BaseRecord(buffer);
int record_number=baseRecord.getBaseRecord_Rty();
RecordNumber[record_number]++;
}
Again, it was due to my ignorance, but an example really would have been helpful!
Or did I miss this information somehow?
--
John McKown
Code: Select all