A method of writing data to a recording medium with a run length limited (RLL) code of the form RLL (d, k, m, n, s), where d is minimum run length, k is maximum run length, m is the data bit length before modulation, n is the codeword bit length after modulation, and s is the space length between codewords, the method comprising:
- using the RLL code with s=2 or greater for pits or lands of the recording medium shorter than a predetermined value, and using the RLL code with s=1 for pits or lands of the recording medium other than the pits or lands shorter than the predetermined value.