• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading .db file

 
mohini lalwani
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Bodgit and Scraper
I am reading .db file using RandomAccessFile but in Sun instruction is written
"All numeric values are stored in the header information use the formats of the DataInputStream and DataOutputStream classes. All text values, and all fields (which are text only), contain only 8 bit characters, null terminated if less than the maximum length for the field. The character encoding is 8 bit US ASCII. "

Q.1 is it okay to use RandomAccessFile or should I go with DataInputStream to read the file ???

Q.2 What is meaning of this
"1 byte "deleted" flag. 0 implies valid record, 1 implies deleted record "

Please reply
 
Jeffry Kristianto Yanuar
Ranch Hand
Posts: 759
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is okay to use RandomAccessFile. I used it too.

when you read a flag (using readByte() perhaps) it will return 1 for deleted flag and 0 for valid record.

When the record is deleted, it is not deleted, but the flag value will be marked by 1.

Hope that's help


Jeffry Kristianto Yanuar (Java Instructor)
SCJP 5.0, SCJA, SCJD (UrlyBird 1.3.2) --> Waiting for the result
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic