@classmethod
def to_binary(cls, val, protocol_version):
    """
        Serialize a value into a bytestring. See the serialize() method for
        more information. This method differs in that if None is passed in,
        the result is the empty string.
        """
    return b'' if val is None else cls.serialize(val, protocol_version)
