@classmethod
def unicode_to_binary(cls, unicode_buf, encoding='utf-8'):
    """
        Unicode to binary buffer, using the specified encoding
        :param unicode_buf: String to convert.
        :type unicode_buf: unicode
        :param encoding: Encoding to use.
        :type encoding: str
        :return bytes
        :rtype bytes
        """
    return unicode_buf.encode(encoding)
