2 byte flag. 00 implies valid record, 0x8000 implies deleted record
Record containing fields in order specified in schema section, no separators between fields, each field fixed length at maximum specified in schema information
4 byte numeric, magic cookie value identifies this as a data file
4 byte numeric, offset to start of record zero
2 byte numeric, number of fields in each record
2. But I could not find anything correspnding to delete falg, IS it at the end of every record. I calculated the bytes for all the fields and there are two extra bytes at the end of every record, but they don't display anything. -- Can I use those two bytes to write this flag -- are those two bytes ment for that -- or -- will i be altering the format of datafile by writing over those two bytes(which I am not supposed to).
The doubt:
The valid record flag 00 means empty bytes(nothing written on it) OR I should write 00 on it, and ofcourse I will be writing 0x8000 if I have to mark a record as deleted.
The valid record flag 00 means empty bytes (nothing written on it) OR I should write 00 on it, and ofcourse I will be writing 0x8000 if I have to mark a record as deleted.
K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
1) range of short is between -32768 to 32767
2) delete flag = 0x8000 = 32768. This is outside the range of short.
1) range of short is between -32768 to 32767
2) delete flag = 0x8000 = 32768. This is outside the range of short.
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Rajesh Said:
if (readShort()==0) {
valid record;
}
else if (readUnsignedShort == 0x8000) {
deleted record;
}
else {
no idea; // can someone explain ?
}
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |