title: Resize bytes in python
body: <p>I read file from disk and in case if its size less than 256 bytes I need to extend it. Some think like:</p>
  
  <pre><code>data = open("test.txt", "rb").read()
  if ( len(data) &lt; 256  ):
      data.resize( 256 ) # Fill with zeroes or something
  </code></pre>
  
  <p>But since bytes is immutable type there is no anything like resize method.</p>
  
  <p>I don't need to modify original file, I need len(data) to be not less than 256 for further processing.</p>