Closed virtual-machinist closed 7 years ago
Hi, saving directly to outputstream makes sense, good point.
I have created a ticket for this, but it won't be developed before the next year. https://www.pivotaltracker.com/story/show/133095765
It would be much appreciated if you could make a pull request with that feature.
Thanks for the feedback!
As of now I've rewritten AsicContainerCreator to use streams where possible. Unfortunately the class itself was not very convenient to extend, so I've created a StreamingAsicContainerCreator, which retains all ZIP entry writing logic. However since they do not share any hierarchy, I had to change
Pull request created, looking forward to receiving some feedback.BDocContainer.writeAsicContainer()
.
In release 1.0.7 the writing of Container directly to an OutputStream is added.
Is there any way to write a Container directly to an OutputStream without storing everything in memory/files?
Container.save(OutputStream)
is a deprecated wrapper forContainer.saveAsStream()
, which creates and returns a ByteArrayInputStream. That is something we might want to avoid, especially for large containers.We can of course use
Container.saveAsFile(String)
(again, why String and no option for File/Path?) to save the contents in a temporary file, then copy it to the OutputStream, but that's a bit tedious IMHO.Is there a reason
Container.save(OutputStream)
is deprecated?