Enable reading data from streams where Stream.Length is not supported

Creating an embedded resource from a stream will fail if the stream do not implement Stream.Length or do not support the operation. 

Original code from Jon Skeet : http://stackoverflow.com/questions/221925/creating-a-byte-array-from-a-stream