def METHOD_NAME(self, record):
    """Write a single record to the output file."""
    handle = self.handle
    sequence = record.seq
    nucleotides = bytes(sequence)
    length = len(sequence)
    handle.write(struct.pack("i", length))
    table = bytes.maketrans(b"TCAGNtcagn", b"0123489abc")
    padding = length % 2
    suffix = padding * b"T"
    nucleotides += suffix
    if not set(nucleotides).issubset(b"ACGTNacgtn"):
        raise ValueError("Sequence should contain A,C,G,T,N,a,c,g,t,n only")
    indices = nucleotides.translate(table)
    handle.write(binascii.unhexlify(indices))