def write(self, fptr):
self._validate(writing=True)<EOL>num_items = len(self.fragment_offset)<EOL>length = <NUM_LIT:8> + <NUM_LIT:2> + num_items * <NUM_LIT><EOL>fptr.write(struct.pack('<STR_LIT>', length, b'<STR_LIT>'))<EOL>fptr.write(struct.pack('<STR_LIT>', num_items))<EOL>for j in range(num_items):<EOL><INDENT>write_buffer = struct.pack('<STR_LIT>',<EOL>self.fragment_offset[j],<EOL>self.fragment_length[j],<EOL>self.data_reference[j])<EOL>fptr.write(write_buffer)<EOL><DEDENT>
Write a fragment list box to file.