本文整理汇总了C#中ICSharpCode.SharpZipLib.GZip.GZipOutputStream.WriteByte方法的典型用法代码示例。如果您正苦于以下问题:C# GZipOutputStream.WriteByte方法的具体用法?C# GZipOutputStream.WriteByte怎么用?C# GZipOutputStream.WriteByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.SharpZipLib.GZip.GZipOutputStream
的用法示例。
在下文中一共展示了GZipOutputStream.WriteByte方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DelayedHeaderWriteWithData
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);
}
示例2: WriteAfterClose
public void WriteAfterClose()
{
TrackedMemoryStream memStream=new TrackedMemoryStream();
GZipOutputStream s=new GZipOutputStream(memStream);
s.Close();
try
{
s.WriteByte(7);
Assert.Fail("Write should fail");
}
catch
{
}
}
示例3: WriteAfterFinish
public void WriteAfterFinish()
{
var memStream = new TrackedMemoryStream();
var s = new GZipOutputStream(memStream);
s.Finish();
try {
s.WriteByte(7);
Assert.Fail("Write should fail");
} catch {
}
}