Reading from a ZipInputStream into a ByteArrayOutputStream

后端 未结 10 1538
旧时难觅i
旧时难觅i 2021-02-05 08:14

I am trying to read a single file from a java.util.zip.ZipInputStream, and copy it into a java.io.ByteArrayOutputStream (so that I can then create a

10条回答
  •  花落未央
    2021-02-05 08:34

    I'd use IOUtils from the commons io project.

    IOUtils.copy(zipStream, byteArrayOutputStream);
    

提交回复
热议问题