A hard disk drive with an encoder that writes data onto a disk in
accordance with a plurality of first codes. Each code contains a
plurality of digital bits. The first codes are selected so that if a bit
is added or dropped during a write or read process the resulting
bitstream can only be one of the selected first codes. This allows the
bitstream to be accurately decoded to detect and correct for the
added/dropped bit.