Variable length records | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
One or more of the fields can be of differing lengths in each record. Advantages:
Disadvantages:
Example : A file that needs to be downloaded from a network site. Eg. An Internet database.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Storage method 1. When the record is stored, each field has a field terminator byte stored at the end of it, and there is often a record terminator at the end of the whole record. The first record of the example would be stored as .....
This record requires 33 bytes of storage.....but each record will be a different size.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Storage method 2. Each field starts with a byte showing the length of the field. The whole record starts with a byte giving the size of the record. The first record of the example would be stored as....
This record requires 34 bytes of storage....but again, each record would be a different size.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||