• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IInputStream类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IInputStream的典型用法代码示例。如果您正苦于以下问题:C# IInputStream类的具体用法?C# IInputStream怎么用?C# IInputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IInputStream类属于命名空间,在下文中一共展示了IInputStream类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InputStreamReader

        public InputStreamReader(IInputStream stream, uint bufferSize)
        {
            _reader = new DataReader(stream);
            _reader.InputStreamOptions = InputStreamOptions.Partial;

            _bufferSize = bufferSize;
        }
开发者ID:HouseOfTheFuture,项目名称:IoT-Device,代码行数:7,代码来源:InputStreamReader.cs


示例2: PushAttachmentData

 public PushAttachmentData(String contentType, IInputStream data, ulong dataSize, byte[] key)
 {
     this.contentType = contentType;
     this.data = data;
     this.dataSize = dataSize;
     this.key = key;
 }
开发者ID:smndtrl,项目名称:libtextsecure-uwp,代码行数:7,代码来源:PushAttachmentData.cs


示例3: ReadStringFromInputStream

 public bool ReadStringFromInputStream(IInputStream inputStream, List<string> messages, out string s)
 {
     var bytesCollection = new List<byte[]>();
     var bytes = new byte[Environment.SystemPageSize];
     while (true)
     {
         var bytesRead = inputStream.Read(bytes, _timeout);
         if (bytesRead <= 0) break;
         var bytesCopy = new byte[bytesRead];
         Buffer.BlockCopy(bytes, 0, bytesCopy, 0, bytesRead);
         bytesCollection.Add(bytesCopy);
     }
     var bytesCount = bytesCollection.Sum(bytesChunk => bytesChunk.Length);
     bytes = new byte[bytesCount];
     var offset = 0;
     foreach (var bytesChunk in bytesCollection)
     {
         Buffer.BlockCopy(bytesChunk, 0, bytes, offset, bytesChunk.Length);
         offset += bytesChunk.Length;
     }
     try
     {
         s = _encoding.GetString(bytes);
     }
     catch (Exception e)
     {
         messages.Add(e.ToString());
         s = null;
         return false;
     }
     return true;
 }
开发者ID:vlindos,项目名称:Vlindos,代码行数:32,代码来源:InputStreamStringReader.cs


示例4: DataReader

		public DataReader (IInputStream inputStream)
		{
			if (inputStream == null)
				throw new ArgumentNullException ("inputStream");

			throw new NotImplementedException();
		}
开发者ID:ermau,项目名称:WinRT.NET,代码行数:7,代码来源:DataReader.cs


示例5: LoadTileSetAsync

 private static async Task<TileSet> LoadTileSetAsync(IInputStream stream)
 {
     using (var reader = new StreamReader(stream.AsStreamForRead()))
     {
         return JsonConvert.DeserializeObject<TileSet>(await reader.ReadToEndAsync());
     }
 }
开发者ID:ChinaRAUnion,项目名称:RedAlertPlus,代码行数:7,代码来源:TileSetReader.cs


示例6: Reader

 internal Reader(
     IInputStream stream,
     files.File file
     )
 {
     this.parser = new FileParser(stream, file);
 }
开发者ID:n9,项目名称:pdfclown,代码行数:7,代码来源:Reader.cs


示例7: ProtectStreamToStream

        /// <summary>
        /// Encrypt an input stream and output to another stream
        /// </summary>
        /// <param name="inStream"></param>
        /// <param name="outStream"></param>
        /// <param name="userDescriptor"></param>
        /// <returns></returns>
        public static async Task ProtectStreamToStream(IInputStream inStream, IOutputStream outStream, string userDescriptor)
        {
            // Create a DataProtectionProvider object for the specified descriptor.
            DataProtectionProvider Provider = new DataProtectionProvider(userDescriptor);

            await Provider.ProtectStreamAsync(inStream, outStream);

        }
开发者ID:CarltonSemple,项目名称:WindowsApps,代码行数:15,代码来源:DataEncryption.cs


示例8: LengthMarkedBufferedInputStream

 public LengthMarkedBufferedInputStream(IInputStream input)
 {
     this.input = input;
     buf = new byte[InitialBufferSize];
     count = 0;
     markedLength = -1;
     markedIndex = -1;
 }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:8,代码来源:LengthMarkedBufferedInputStream.cs


示例9: FileParser

   internal FileParser(
 IInputStream stream,
 files.File file
 )
       : base(stream)
   {
       this.file = file;
   }
开发者ID:jujubeast,项目名称:PDFEditor,代码行数:8,代码来源:FileParser.cs


示例10: AfmParser

        internal AfmParser(
      IInputStream fontData
      )
        {
            FontData = fontData;

              Load();
        }
开发者ID:n9,项目名称:pdfclown,代码行数:8,代码来源:AfmParser.cs


示例11: DecryptStream

        /// <summary>
        /// Decrypt an input stream and output to another stream
        /// </summary>
        /// <param name="readStream"></param>
        /// <param name="outStream"></param>
        /// <returns></returns>
        public static async Task DecryptStream(IInputStream readStream, IOutputStream outStream, string userDescriptor)
        {
            // Create a DataProtectionProvider object for the specified descriptor.
            DataProtectionProvider Provider = new DataProtectionProvider(userDescriptor);

            await Provider.UnprotectStreamAsync(readStream, outStream);     // decrypt and output

            return;
        }
开发者ID:CarltonSemple,项目名称:WindowsApps,代码行数:15,代码来源:DataEncryption.cs


示例12: Open

        public void Open(IInputStream input, IOutputStream output)
        {
            m_DataReader = new DataReader(input);
            m_DataReader.ByteOrder = ByteOrder.LittleEndian;
            m_Reader.Reader = m_DataReader;

            m_DataWriter = new DataWriter(output);
            m_DataWriter.ByteOrder = ByteOrder.LittleEndian;
            m_Writer.Writer = m_DataWriter;
        }
开发者ID:spinglass,项目名称:PerformantApp,代码行数:10,代码来源:Sender.cs


示例13: HashedInputStream

        public HashedInputStream(IInputStream stream)
        {
            if (stream == null)
                throw new ArgumentNullException("stream");

            _stream = stream;
            _sha = HashAlgorithmProvider
                .OpenAlgorithm(HashAlgorithmNames.Sha256)
                .CreateHash();
        }
开发者ID:Confuset,项目名称:7Pass-Remake,代码行数:10,代码来源:HashedInputStream.cs


示例14: writeStream

        protected void writeStream(IInputStream input)// throws IOException
        {
            /*byte[] buffer = new byte[4096];
            int read;

            while ((read = input.read(buffer)) != -1) {
                output.write(buffer, 0, read);
            }

            input.close();*/
            throw new NotImplementedException();
        }
开发者ID:smndtrl,项目名称:libtextsecure-uwp,代码行数:12,代码来源:ChunkedOutputStream.cs


示例15: ParseRequestStream

        internal async Task<HttpRequest> ParseRequestStream(IInputStream requestStream)
        {
            var httpStream = new HttpRequestStream(requestStream);
            var request = new HttpRequest();

            try
            {
                var stream = await httpStream.ReadAsync(BUFFER_SIZE, InputStreamOptions.Partial);
                byte[] streamData = stream.Data;

                var requestPipeline = GetPipeline();
                using (var pipeLineEnumerator = requestPipeline.GetEnumerator())
                {
                    pipeLineEnumerator.MoveNext();
                    bool requestComplete = false;

                    while (!requestComplete)
                    {
                        pipeLineEnumerator.Current.HandleRequestPart(streamData, request);
                        streamData = pipeLineEnumerator.Current.UnparsedData;

                        if (pipeLineEnumerator.Current.IsFinished)
                        {
                            if (!pipeLineEnumerator.Current.IsSucceeded ||
                                !pipeLineEnumerator.MoveNext())
                            {
                                break;
                            }
                        }
                        else
                        {
                            var newStreamdata = await httpStream.ReadAsync(BUFFER_SIZE, InputStreamOptions.Partial);

                            if (!newStreamdata.ReadSuccessful)
                            {
                                break;
                            }

                            streamData = streamData.ConcatArray(newStreamdata.Data);
                        }
                    }
                }

                request.IsComplete = requestPipeline.All(p => p.IsSucceeded);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

            return request;
        }
开发者ID:Ferho,项目名称:restup,代码行数:52,代码来源:HttpRequestParser.cs


示例16: TailoredUploadOperation

 /// <summary>
 /// This class implements the upload operation on Windows 8 using the background uploader.
 /// </summary>
 /// <remarks>This constructor is used when uploading a stream created by the application.</remarks>
 public TailoredUploadOperation(
     LiveConnectClient client,
     Uri url,
     string fileName,
     IInputStream inputStream,
     OverwriteOption option,
     IProgress<LiveOperationProgress> progress,
     SynchronizationContextWrapper syncContext)
     : this(client, url, fileName, option, progress, syncContext)
 {
     Debug.Assert(inputStream != null, "inputStream is null.");
     this.InputStream = inputStream;
 }
开发者ID:kam193,项目名称:LiveSDK-for-Windows,代码行数:17,代码来源:TailoredUploadOperation.cs


示例17: CreateBackgroundUploadOperation

        /// <summary>
        /// This class implements the upload operation on Windows 8 using the background uploader.
        /// </summary>
        /// <remarks>This constructor is used when uploading a stream created by the application.</remarks>
        public CreateBackgroundUploadOperation(
            LiveConnectClient client,
            Uri url,
            string fileName,
            IInputStream inputStream,
            OverwriteOption option)
            : base(client, url, ApiMethod.Upload, null, null)
        {
            Debug.Assert(inputStream != null, "inputStream is null.");

            this.InputStream = inputStream;
            this.FileName = fileName;
            this.OverwriteOption = option;
        }
开发者ID:harishdotnarayanan,项目名称:LiveSDK-for-Windows,代码行数:18,代码来源:CreateBackgroundUploadOperation.cs


示例18: Copy

		/// <exception cref="System.IO.IOException"></exception>
		protected virtual void Copy(IInputStream rawin, Socket4Adapter sock, bool update)
		{
			BufferedInputStream @in = new BufferedInputStream(rawin);
			byte[] buffer = new byte[BlobImpl.CopybufferLength];
			int bytesread = -1;
			while ((bytesread = rawin.Read(buffer)) >= 0)
			{
				sock.Write(buffer, 0, bytesread);
				if (update)
				{
					_currentByte += bytesread;
				}
			}
			@in.Close();
		}
开发者ID:Galigator,项目名称:db4o,代码行数:16,代码来源:MsgBlob.cs


示例19: StreamWatcher

        public StreamWatcher( IInputStream stream )
        {
            if ( stream == null ) throw new ArgumentNullException( "stream" );

            ReadSize = 256;

            _reader = new DataReader( stream )
            {
                ByteOrder = ByteOrder.LittleEndian,
                InputStreamOptions = InputStreamOptions.Partial
            };

            Task.Factory.StartNew( CheckForData, _tokenSource.Token, TaskCreationOptions.LongRunning,
                TaskScheduler.Default );
        }
开发者ID:barometz,项目名称:flint,代码行数:15,代码来源:StreamWatcher.cs


示例20: ReadInputStream

 private async Task<StringBuilder> ReadInputStream(IInputStream InputStream)
 {
     StringBuilder requestbuilder = new StringBuilder();
     using (IInputStream input = InputStream)
     {
         byte[] data = new byte[BufferSize];
         IBuffer buffer = data.AsBuffer();
         uint dataRead = BufferSize;
         while (dataRead == BufferSize)
         {
             await input.ReadAsync(buffer, BufferSize, InputStreamOptions.Partial);
             requestbuilder.Append(Encoding.UTF8.GetString(data, 0, data.Length));
             dataRead = buffer.Length;
         }
     }
     return requestbuilder;
 }
开发者ID:LeighCurran,项目名称:IoTExamples,代码行数:17,代码来源:RestServer.cs



注:本文中的IInputStream类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IInstruction类代码示例发布时间:2022-05-24
下一篇:
C# IInputParameters类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap