Releasing the base stream returned by Application.GetResourceStream on WP7

When accessing a resource using Application.GetResourceStreamit, it returns an instance of the class StreamResourceInfo; this class does not implement IDisposable.

Should I close \ dispose the underlying thread open StreamResourceInfowhen I finished processing the thread on the WP7 device - I don't want to know about Usingor the Dispose pattern.

As an example, you can use the method to access the ZIP file contained in the ZAP package, and as soon as I unzip the file, I no longer need an instance Stream.

+5
source share
3 answers

using, Close() Dispose().

StreamResourceInfo Close() Dispose() ( StreamResourceInfo Stream - , ), , , .

, StreamResourceInfo , Dispose() Stream , Reflector, , . IDisposable .

, , Close() Stream.

+3

Windows 7 , , , , . , . , , .

0

Using dispose Using. , - . , , .

 using (var stream = Application.GetResourceStream(new Uri("myResource.zip", UriKind.Relative)).Stream)
 {
       //stream code
 }

EDIT - : StreamResourceInfo / Stream. (, StreamReader), . , , .

0
source

All Articles