public void DelayedHeaderWriteWithData() { var ms = new MemoryStream(); Assert.AreEqual(0, ms.Length); using (GZipOutputStream outStream = new GZipOutputStream(ms)) { Assert.AreEqual(0, ms.Length); outStream.WriteByte(45); // Should in fact contain header right now with // 1 byte in the compression pipeline Assert.AreEqual(10, ms.Length); } byte[] data = ms.ToArray(); Assert.IsTrue(data.Length > 0); }
public void WriteAfterClose() { TrackedMemoryStream memStream=new TrackedMemoryStream(); GZipOutputStream s=new GZipOutputStream(memStream); s.Close(); try { s.WriteByte(7); Assert.Fail("Write should fail"); } catch { } }
public void WriteAfterFinish() { var memStream = new TrackedMemoryStream(); var s = new GZipOutputStream(memStream); s.Finish(); try { s.WriteByte(7); Assert.Fail("Write should fail"); } catch { } }