Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Deleted record

 
Patrick McDonogh
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering if anyone knows about a better solution to the problem of marking a record as deleted.
If a record is deleted it says it must be market with 0x8000 which is the first two bytes before the start of the record.

I am creating a short to do this i.e. short s = (short)0x8000 and writing it to the file in the correct place.

If i read the short(2 bytes) ive just written i get -32768 as the answer. I know this has something to do with how i cast the number from int to short. So what i was wondering is if anyone knows a way or could pointme in a direction to write 32768 in two bytes.

Thanks a lot
 
Patrick McDonogh
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please ignore as i found out that if i write the bytes as a short and read them as an integer using getUnsignedShort() in RandomAccessFile class then i get the correct figure.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic