本文整理汇总了C#中System.IO.Stream.Flush方法的典型用法代码示例。如果您正苦于以下问题:C# System.IO.Stream.Flush方法的具体用法?C# System.IO.Stream.Flush怎么用?C# System.IO.Stream.Flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.Stream
的用法示例。
在下文中一共展示了System.IO.Stream.Flush方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Save
public void Save(Stream stream)
{
if (GraphSaving != null)
GraphSaving(this, EventArgs.Empty);
foreach (DrawingNode n in Graph.Nodes)
n.GeometryObject.UserData = n.Id;
Graph.WriteToStream(stream);
stream.Flush();
if (GraphSaved != null)
GraphSaved(this, EventArgs.Empty);
}
示例2: CopyAndFlush
/// <summary>
/// Transfers a source stream to a target and flushes the target
/// </summary>
/// <param name="source">
/// The stream to read
/// </param>
/// <param name="target">
/// The stream to write
/// </param>
/// <returns>
/// The total number of bytes transferred
/// </returns>
public Int32 CopyAndFlush(Stream source, Stream target)
{
var copied = Copy(source, target);
target.Flush();
return copied;
}