'Render `data` into JSON, returning a bytestring.'

def render(self, data, accepted_media_type=None, renderer_context=None):

    if (data is None):
        return bytes()
    renderer_context = (renderer_context or {})
    indent = self.get_indent(accepted_media_type, renderer_context)
    if (indent is None):
        separators = (SHORT_SEPARATORS if self.compact else LONG_SEPARATORS)
    else:
        separators = INDENT_SEPARATORS
    ret = json.dumps(data, cls=self.encoder_class, indent=indent, ensure_ascii=self.ensure_ascii, separators=separators)
    if isinstance(ret, six.text_type):
        ret = ret.replace(u'\u2028', u'\\u2028').replace(u'\u2029', u'\\u2029')
        return bytes(ret.encode(u'utf-8'))
    return ret
