本文整理汇总了C#中Windows.Storage.Streams.DataReader.ReadUInt64方法的典型用法代码示例。如果您正苦于以下问题:C# DataReader.ReadUInt64方法的具体用法?C# DataReader.ReadUInt64怎么用?C# DataReader.ReadUInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.Storage.Streams.DataReader
的用法示例。
在下文中一共展示了DataReader.ReadUInt64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read(DataReader reader)
{
t = (HeartBeatType)reader.ReadInt32();
time = reader.ReadDateTime().UtcDateTime;
cc = reader.ReadInt64();
asdf = reader.ReadInt64();
peak = reader.ReadInt64();
max0 = reader.ReadUInt64();
max1 = reader.ReadUInt64();
ave0 = reader.ReadUInt64();
ave1 = reader.ReadUInt64();
ave = reader.ReadUInt64();
beat = reader.ReadUInt64();
audio = reader.ReadUInt64();
noAudio = reader.ReadUInt64();
}
示例2: ReadFileAsync
public async Task<IStorageFile> ReadFileAsync(StreamSocket socket, StorageFolder folder, string outputFilename = null)
{
StorageFile file;
using (var rw = new DataReader(socket.InputStream))
{
// 1. Read the filename length
await rw.LoadAsync(sizeof(Int32));
var filenameLength = (uint)rw.ReadInt32();
// 2. Read the filename
await rw.LoadAsync(filenameLength);
var originalFilename = rw.ReadString(filenameLength);
if (outputFilename == null)
{
outputFilename = originalFilename;
}
//3. Read the file length
await rw.LoadAsync(sizeof(UInt64));
var fileLength = rw.ReadUInt64();
// 4. Reading file
var buffer = rw.ReadBuffer((uint)fileLength);
file = await ApplicationData.Current.LocalFolder.CreateFileAsync(outputFilename, CreationCollisionOption.ReplaceExisting);
await FileIO.WriteBufferAsync(file, buffer);
//using (var memStream = await DownloadFile(rw, fileLength))
//{
// file = await folder.CreateFileAsync(outputFilename, CreationCollisionOption.ReplaceExisting);
// using (var fileStream1 = await file.OpenAsync(FileAccessMode.ReadWrite))
// {
// await RandomAccessStream.CopyAndCloseAsync(memStream.GetInputStreamAt(0), fileStream1.GetOutputStreamAt(0));
// }
// rw.DetachStream();
//}
}
return file;
}