I'm assuming "file" is a zip device and there is a chance it needs to be read byte by byte. In that case the only thing you can do is read byte by byte but then write block by block. If "out" is a zip device then of course you need to reverse what I've written here (i.e. read block by block and write byte by byte).