public void close() { eof = true; buf = null; pendinglen = 0; offset = 0; try { if (_stream != null && closeStream) _stream.Dispose(); } catch (Exception e) { PngHelperInternal.Log("Exception closing stream", e); } _stream = null; }