How do I convert a binary image into an in-memory data structure in python?
<p>Context: </p>

<ul>
<li>I am using python 2.6.5</li>
</ul>

<p>Goal:</p>

<ul>
<li>Read a binary image file and represent it in-memory. Then run a checksum on it. Deliver the binary representation to be stored as a blob in mysql.</li>
</ul>

<p>Comments:</p>

<ul>
<li>I have read this <a href="http://stackoverflow.com/questions/7380460/byte-array-in-python">SO thread</a>.</li>
<li>I have looked at the <a href="http://docs.python.org/library/struct.html" rel="nofollow">struct</a> module. </li>
<li>I also have bumped into the <a href="http://docs.python.org/library/io.html" rel="nofollow">io</a> module.</li>
<li>With all the available options, I am not certain which is the best solution. The BytesIO data structure seems to be suitable for my needs. Which one do you think will meet my requirements ?</li>
</ul>
