data stream wrapper - RFC 2397

Implemented data stream wrapper, based on RFC 2397 and Zend implementation.

While the patch can read the metadata of a stream, it does not save it
anywhere, and thus will not pass zend's stream meta data tests for RFC
2397.

This should fix issue #1051