title: Open binary file in zip archive as ZipExtFile
body: <p>I'm trying to access a binary stream (via a ZipExtFile object) from a data file contained in a Zip archive. To incrementally read in a text file object from the archive, this would be fairly straightforward:</p>
  
  <pre><code>with ziparchive as ZipFile("myziparchive.zip", 'r'):
      with txtfile as ziparchive.open("mybigtextfile.txt", 'r'):
         for line in txtfile:
             ....
  </code></pre>
  
  <p>Ideally the byte stream equivalent would be something like:</p>
  
  <pre><code>with ziparchive as ZipFile("myziparchive.zip", 'r'):
      with binfile as ziparchive.open("mybigbinary.bin", 'rb'):
          while notEOF
              binchunk = binfile.read(MYCHUNKSIZE)
              ....
  </code></pre>
  
  <p>Unfortunately, <code>ZipFile.open</code> doesn't seem to support reading binary data to a ZipExtFile object. From the <a href="https://docs.python.org/3.3/library/zipfile.html#zipfile.ZipFile.open" rel="nofollow noreferrer">docs</a>:</p>
  
  <blockquote>
    <p>The mode parameter, if included, must be one of the following: 'r'
    (the default), 'U', or 'rU'.</p>
  </blockquote>
  
  <p>Given this constraint, how best to incrementally read in the binary file directly from the archive? Since the uncompressed file is quite large I'd like to avoid extracting it first.</p>