title: BytesIO with python v2.5
body: <p><strong>Question:</strong></p>
  
  <p>How do I get a byte stream that works like StringIO for Python 2.5?</p>
  
  <p><strong>Application:</strong></p>
  
  <p>I'm converting a PDF to text, but don't want to save a file to the hard disk.</p>
  
  <p><strong>Other Thoughts:</strong></p>
  
  <p>I figured I could use StringIO, but there's no mode parameter (I guess "String" implies text mode). </p>
  
  <p>Apparently the io.BytesIO class is new in v2.6, so that doesn't work for me either.</p>
  
  <p>I've got a solution with the tempfile module, but I'd like to avoid any reads/writes to/from the hard disk.</p>