Skip to content

Commit 12b5f92

Browse files
committed
GZipOutputStream.Close now honours stream ownership
1 parent 4fe0cce commit 12b5f92

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/GZip/GzipOutputStream.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,10 @@ public override void Write(byte[] buf, int off, int len)
149149
public override void Close()
150150
{
151151
Finish();
152-
baseOutputStream.Close();
152+
153+
if ( IsStreamOwner ) {
154+
baseOutputStream.Close();
155+
}
153156
}
154157

155158
/// <summary>
@@ -176,6 +179,7 @@ public int GetLevel()
176179
{
177180
return def.GetLevel();
178181
}
182+
179183
/// <summary>
180184
/// Finish compression and write any footer information required to stream
181185
/// </summary>

0 commit comments

Comments
 (0)