shrinkwrap / descriptors

ShrinkWrap subproject for creating Archive Descriptors
Apache License 2.0
26 stars 30 forks source link

Shrinkdesc 20 - Allow import from empty streams for Descriptor Import #11

Closed andygibson closed 13 years ago

andygibson commented 13 years ago

Here's a fix for importing from empty streams. It does it by reading the stream to a string, and then reading from the string after checking to see if it is empty or not. If it is empty, it returns a new empty instance of the descriptor. If not, the descriptor is loaded as normal.

ALRubinger commented 13 years ago

Thanks for contributing this, Andy.

I've taken your work and refactored it a bit to match the current design: https://github.com/shrinkwrap/descriptors/commit/e4ba790c2f530b2abe75ffbd7ca6b33631c348e4