(thing, encoding=None, armor=True)
return rv
Encode **thing**, then make it stream/file-like.

    :param thing: The thing to turn into a encoded stream.
    :rtype: ``io.BytesIO`` or ``io.StringIO``.
    :returns: The encoded **thing**, wrapped in an ``io.BytesIO`` (if
        available), otherwise wrapped in a ``io.StringIO``.
Encode **thing**, then make it stream/file-like.
Encode ** thing ** then make it stream / file - like .
def _make_binary_stream(thing, encoding=None, armor=True):
    """Encode **thing**, then make it stream/file-like.

    :param thing: The thing to turn into a encoded stream.
    :rtype: ``io.BytesIO`` or ``io.StringIO``.
    :returns: The encoded **thing**, wrapped in an ``io.BytesIO`` (if
        available), otherwise wrapped in a ``io.StringIO``.
    """
    if _py3k:
        if isinstance(thing, str):
            thing = thing.encode(encoding)
    else:
        if type(thing) is not str:
            thing = thing.encode(encoding)

    try:
        rv = BytesIO(thing)
    except NameError:
        rv = StringIO(thing)

    return rv
def _make_binary_stream ( thing , encoding = None , armor = True ) : if _py3k : if isinstance ( thing , str ) : thing = thing . encode ( encoding ) else : if type ( thing ) is not str : thing = thing . encode ( encoding ) try : rv = BytesIO ( thing ) except NameError : rv = StringIO ( thing ) return rv