当前位置: 首页>>代码示例>>C#>>正文


C# IOutputStream类代码示例

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


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

示例1: DataWriter

		public DataWriter (IOutputStream outputStream)
		{
			if (outputStream == null)
				throw new ArgumentNullException ("outputStream");

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

示例2: WriteResponseAsync

        private async Task WriteResponseAsync(string[] requestTokens, IOutputStream outstream)
        {
            // NOTE: If you change the respBody format, change the Content-Type (below) accordingly
            //string respBody = weatherData.HTML;
            //string respBody = weatherData.XML;
            string respBody = weatherData.JSON;

            string htmlCode = "200 OK";

            using (Stream resp = outstream.AsStreamForWrite())
            {
                byte[] bodyArray = Encoding.UTF8.GetBytes(respBody);
                MemoryStream stream = new MemoryStream(bodyArray);

                // NOTE: If you change the respBody format (above), change the Content-Type accordingly
                string header = string.Format("HTTP/1.1 {0}\r\n" +
                                              //"Content-Type: text/html\r\n" + // HTML only
                                              //"Content-Type: text/xml\r\n" +  // XML only
                                              "Content-Type: text/json\r\n" + // JSON only
                                              "Content-Length: {1}\r\n" +
                                              "Connection: close\r\n\r\n",
                                              htmlCode, stream.Length);

                byte[] headerArray = Encoding.UTF8.GetBytes(header);
                await resp.WriteAsync(headerArray, 0, headerArray.Length);
                await stream.CopyToAsync(resp);
                await resp.FlushAsync();
            }
        }
开发者ID:JimGaleForce,项目名称:iot-build-lab,代码行数:29,代码来源:HttpServer.cs

示例3: WriteTo

 public override void WriteTo(
     IOutputStream stream,
     Document context
     )
 {
     stream.Write(value);
 }
开发者ID:n9,项目名称:pdfclown,代码行数:7,代码来源:InlineImageBody.cs

示例4: CompressedWriter

   internal CompressedWriter(
 files.File file,
 IOutputStream stream
 )
       : base(file, stream)
   {
   }
开发者ID:n9,项目名称:pdfclown,代码行数:7,代码来源:CompressedWriter.cs

示例5: Initialize

        public bool Initialize(IOutputStream _stream)
        {
            stream = _stream;

            Print("Controller.Initialize is success.");
            return true;
        }
开发者ID:gordonlee,项目名称:testlab,代码行数:7,代码来源:CommandController.cs

示例6: RegisterOutputStream

        /// <summary>
        /// Register output stream.
        /// </summary>
        /// <param name="output_stream"></param>
        public static void RegisterOutputStream(
            IOutputStream output_stream)
        {
            OutputStreamHost.InitializeIfNeeded();

            _output_streams.Add(output_stream);
        }
开发者ID:jorik041,项目名称:osmsharp,代码行数:11,代码来源:OutputStreamHost.cs

示例7: Copy

		/// <exception cref="System.IO.IOException"></exception>
		protected virtual void Copy(Socket4Adapter sock, IOutputStream rawout, int length
			, bool update)
		{
			BufferedOutputStream @out = new BufferedOutputStream(rawout);
			byte[] buffer = new byte[BlobImpl.CopybufferLength];
			int totalread = 0;
			while (totalread < length)
			{
				int stilltoread = length - totalread;
				int readsize = (stilltoread < buffer.Length ? stilltoread : buffer.Length);
				int curread = sock.Read(buffer, 0, readsize);
				if (curread < 0)
				{
					throw new IOException();
				}
				@out.Write(buffer, 0, curread);
				totalread += curread;
				if (update)
				{
					_currentByte += curread;
				}
			}
			@out.Flush();
			@out.Close();
		}
开发者ID:erdincay,项目名称:db4o,代码行数:26,代码来源:MsgBlob.cs

示例8: 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

示例9: Writer

   protected Writer(
 File file,
 IOutputStream stream
 )
   {
       this.file = file;
         this.stream = stream;
   }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:8,代码来源:Writer.cs

示例10: WriteTo

   public override void WriteTo(
 IOutputStream stream,
 Document context
 )
   {
       stream.Write(BeginChunk);
         base.WriteTo(stream, context);
         stream.Write(EndChunk);
   }
开发者ID:josuecorrea,项目名称:DanfeSharp,代码行数:9,代码来源:Text.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: DownloadAsync

        public IAsyncAction DownloadAsync(IRecord record, IOutputStream destination)
        {
            if (record == null)
            {
                throw new ArgumentNullException("record");
            }

            return record.DownloadBlob(this, destination);
        }
开发者ID:shashidharpalli,项目名称:Enabling-Programmable-Self-with-HealthVault,代码行数:9,代码来源:Blob.cs

示例13: 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

示例14: HashedOutputStream

        public HashedOutputStream(IOutputStream stream)
        {
            if (stream == null)
                throw new ArgumentNullException("stream");

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

示例15: RemotePeer

 public RemotePeer(ICommandSerializer serializer, ICommandsTransportResource transport, IOutputStream stream, HostName host, string port)
 {
     _serializer = serializer;
     _transport = transport;
     _dataWriter = new DataWriter(stream);
     HostName = host.RawName;
     Port = port;
     HandleActivity();
     _transport.Received += _transport_Received;
 }
开发者ID:Bootz,项目名称:VoIP_Project_Archives_Testing,代码行数:10,代码来源:RemotePeer.cs


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