'Validate ByteString property.
Returns:
A valid value.
Raises:
BadValueError if property is not instance of \'ByteString\'.'

def validate(self, value):

    if ((value is not None) and (not isinstance(value, ByteString))):
        try:
            value = ByteString(value)
        except TypeError as err:
            raise BadValueError(('Property    %s    must    be    convertible    to    a    ByteString    instance    (%s)' % (self.name, err)))
    value = super(ByteStringProperty, self).validate(value)
    if ((value is not None) and (not isinstance(value, ByteString))):
        raise BadValueError(('Property    %s    must    be    a    ByteString    instance' % self.name))
    if ((value is not None) and (len(value) > self.MAX_LENGTH)):
        raise BadValueError(('Property    %s    is    %d    bytes    long;    it    must    be    %d    or    less.' % (self.name, len(value), self.MAX_LENGTH)))
    return value
