I am reading and writting to my file fine except for the record indicator (2 byte flag). Part of my database schema states
"Data section. (offset into file equal to "offset to start of record zero" value) Repeat to end of file: 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"
My question is how do I write/read 0X8000 to the file as a 2 byte flag??? When I read this flag I use the following code: byte b = new byte; raf.read(b); // Read the two bit flag Where b = 0 and b = 0 for a valid record. But I don't understand how to write 0X8000 and if raf.read(b) will correctly read 0X8000. If I read 0X8000 using read(b) what will b and b equal (I cant test this yet because I don't know how to write 0X8000 as a two byte flag yet).