Search code examples
c#pythonmemorystream

MemoryStream analog in Python


Does some analog of C# MemoryStream exist in Python (that could allow me to write binary data from some source direct into memory)? And how would I go about using it?


Solution

  • StringIO is one possibility: http://docs.python.org/library/stringio.html

    This module implements a file-like class, StringIO, that reads and writes a string buffer (also known as memory files). See the description of file objects for operations (section File Objects). (For standard strings, see str and unicode.)...