本文整理汇总了C#中IRuntime.StartRead方法的典型用法代码示例。如果您正苦于以下问题:C# IRuntime.StartRead方法的具体用法?C# IRuntime.StartRead怎么用?C# IRuntime.StartRead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IRuntime
的用法示例。
在下文中一共展示了IRuntime.StartRead方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartRead
private static void StartRead(IRuntime runtime, StreamPump pump, int myId)
{
// item 491
pump.Read = runtime.StartRead(
pump.InStream,
pump.InBuffer,
myId
);
}
示例2: CreateFilePump
private static int CreateFilePump(IRuntime runtime, string path, int manager, HttpListenerResponse response)
{
// item 697
if (File.Exists(path)) {
// item 698
Stream fstream = TryOpenFile(path);
// item 699
if (fstream == null) {
// item 703
runtime.Log.Info(
"Could not open file: "
+ path
);
// item 701
return 0;
} else {
// item 691
FileInfo about = new FileInfo(path);
// item 696
runtime.Log.Info(
String.Format(
"Found file: {0}. Length: {1}",
path,
(int)about.Length
)
);
// item 689
var pump = new StreamPump();
pump.Manager = manager;
pump.TotalLength = (int)about.Length;
pump.InStream = fstream;
pump.OutStream = response.OutputStream;
// item 690
int id = runtime.AddActor(pump);
// item 692
response.StatusCode = 200;
response.ContentLength64 = pump.TotalLength;
// item 694
runtime.StartRead(
pump.InStream,
pump.InBuffer,
id
);
// item 695
return id;
}
} else {
// item 702
runtime.Log.Info(
"File not found: "
+ path
);
// item 701
return 0;
}
}