title: My stream keeps throwing Read/Write Timeout exceptions
body: <p>I am parsing a PowerPoint presentation using Open Office SDK 2.0.  At one point in the program I'm passing a stream to a method that will return an image's MD5.  However, there seems to be a problem in the stream, before it even gets to my MD5 method.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>// Get image information here.
  var blipRelId = blip.Embed;
  var imagePart = (ImagePart)slidePart.GetPartById(blipRelId);
  var imageFileName = imagePart.Uri.OriginalString;
  var imageStream = imagePart.GetStream();
  var imageMd5 = Hasher.CalculateStreamHash(imageStream);
  </code></pre>
  
  <p>In debug, before I let it drop into <code>Hasher.CalculateStreamHash</code>, I check the imageStream properties.  Immediately, I see that the ReadTimeout and WriteTimeout both have similar errors:</p>
  
  <pre><code>imageStream.ReadTimeout' threw an exception of type 'System.InvalidOperationException
  imageStream.WriteTimeout' threw an exception of type 'System.InvalidOperationException
  </code></pre>
  
  <p>Here's a picture of the properties that I"m seeing during debug, in case it helps:
  <img src="https://i.stack.imgur.com/VVLpn.png" alt="enter image description here"></p>
  
  <p>This code is running over a PowerPoint presentation.  I'm wondering if the fact that it's zipped (a PowerPoint presentation is basically just a zipped up file) is the reason I'm seeing those timeout errors?</p>
  
  <p>UPDATE:  I tried taking the stream, getting the image and converting it to a byte array and sending that to the MD5 method as a memory stream, but I still get those same errors in the Read/Write Timeout properties of the stream.  Here's the code as it is now:</p>
  
  <pre><code>// Get image information here.
  var blipRelId = blip.Embed;
  var imagePart = (ImagePart)slidePart.GetPartById(blipRelId);
  var imageFileName = imagePart.Uri.OriginalString;
  var imageStream = imagePart.GetStream();
  
  // Convert image to memory stream
  var img = Image.FromStream(imageStream);
  var imageMemoryStream = new MemoryStream(this.imageToByteArray(img));
  var imageMd5 = Hasher.CalculateStreamHash(imageMemoryStream);
  </code></pre>
  
  <p>For clarity, here's the signature for the CalculateStreamHash method:</p>
  
  <pre><code>public static string CalculateStreamHash([NotNull] Stream stream)
  </code></pre>