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


C# System.Stream类代码示例

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


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

示例1: Different_names_generate_different_hashes

        public void Different_names_generate_different_hashes()
        {
            var a = new Stream("abc");
            var b = new Stream("xyz");

            Assert.NotEqual(a, b);
        }
开发者ID:promontis,项目名称:Even,代码行数:7,代码来源:StreamTests.cs

示例2: StreamListItem

 public StreamListItem(Stream audioStream)
 {
     // Set Stream
     stream = audioStream;
     // Create components
     InitializeComponent();
 }
开发者ID:orryverducci,项目名称:ShockCast,代码行数:7,代码来源:StreamListItem.cs

示例3: When_provisioning_along_with_custom_properties

        public async void When_provisioning_along_with_custom_properties()
        {
            var properties = new Dictionary<string, EntityProperty>
            {
                {"Created", new EntityProperty(DateTimeOffset.Now)},
                {"Active",  new EntityProperty(true)}
            };

            var stream = await Stream.ProvisionAsync(partition, StreamProperties.From(properties));
            var entity = partition.RetrieveStreamEntity();

            var expectedStream = new Stream
            (
                partition,
                entity.ETag, 0, 
                StreamProperties.From(properties)
            );

            stream.ShouldEqual(expectedStream.ToExpectedObject());

            var expectedEntity = new
            {
                RowKey = Api.StreamRowKey,
                Properties = StreamProperties.From(properties),
                Version = 0
            };

            entity.ShouldMatch(expectedEntity.ToExpectedObject());
        }
开发者ID:kowalot,项目名称:Streamstone,代码行数:29,代码来源:Provisioning_stream.cs

示例4: RateTransposer

		short prev; // 1音前のデータを一時的に保存しておく。

		#endregion
		#region 初期化

		/// <summary>
		/// 初期化。
		/// </summary>
		/// <param name="stream">内部ストリーム</param>
		/// <param name="rate">変換レート</param>
		public RateTransposer(Stream stream, double rate)
		{
			this.stream = stream;
			this.rate = rate;
			this.inputBuffer = null;
			this.prev = 0;
		}
开发者ID:ufcpp,项目名称:UfcppSample,代码行数:17,代码来源:RateTransposer.cs

示例5: Reify

 public Output Reify(
     Cell<IMaybe<Size>> size,
     Stream<MouseEvent> sMouse, Stream<KeyEvent> sKey,
     Cell<long> focus, Supply idSupply)
 {
     return this.reify(size, sMouse, sKey, focus, idSupply);
 }
开发者ID:Angeldude,项目名称:sodium,代码行数:7,代码来源:Fridget.cs

示例6: Run

        public override void Run()
        {
            // This is a sample worker implementation. Replace with your logic.
            Trace.WriteLine("Shadow.UShadow.Cloud.Worker entry point called", "Information");

            // Connect to Twitter.
            //
            Stream.ProcessTweetDelegate produceTweetDelegate = new Stream.ProcessTweetDelegate(processTweet);

            // Creating the stream and specifying the delegate
            Stream myStream = new Stream(produceTweetDelegate);

            Token token = new Token()
            {
                AccessToken = "14910567-1AnQzrOuwPFsPd9HrcXrCPBmW7Cwf7doxXqd5vdgi",
                AccessTokenSecret = "hHzkPdejgaJkt9VKxW7JGDC0AnJ5GzvlRjhNaHzYzW4",
                ConsumerKey = "WFYdWcCCTZk4ASituGqhqQ",
                ConsumerSecret = "DfOmNZOrhN31vuEDpm10lxkSSB1MfjVA4Y9oPzSK0gc"
            };

            myStream.StreamUrl = "https://userstream.twitter.com/1.1/user.json?with=user&track=!Shadow";

            // Starting the stream by specifying credentials thanks to the Token
            myStream.StartStream(token);

            while (true)
            {
                Thread.Sleep(10000);
                Trace.WriteLine("Working", "Information");
            }
        }
开发者ID:tomasmcguinness,项目名称:shadow.io,代码行数:31,代码来源:WorkerRole.cs

示例7: ReadByte

 public static byte ReadByte(Stream s)
 {
     int v = s.ReadByte();
     if (v == -1)
         throw new Exception("IOException: EOF");
     return (byte)v;
 }
开发者ID:divyang4481,项目名称:bclcontrib-scriptsharp,代码行数:7,代码来源:SE.cs

示例8: Same_name_generates_equal_streams

        public void Same_name_generates_equal_streams()
        {
            var a = new Stream("123");
            var b = new Stream("123");

            Assert.Equal(a, b);
        }
开发者ID:promontis,项目名称:Even,代码行数:7,代码来源:StreamTests.cs

示例9: InternalReadByte

 public static int InternalReadByte(Stream s)
 {
     int v = s.ReadByte();
     if (v == -1)
         throw new Exception("IOException: EOF");
     return v;
 }
开发者ID:divyang4481,项目名称:bclcontrib-scriptsharp,代码行数:7,代码来源:SE.cs

示例10: Names_must_be_case_insensitive

        public void Names_must_be_case_insensitive()
        {
            var a = new Stream("foobar");
            var b = new Stream("FooBAR");

            Assert.Equal(a, b);
        }
开发者ID:promontis,项目名称:Even,代码行数:7,代码来源:StreamTests.cs

示例11: NavigateToStream

        internal void NavigateToStream(Stream streamObject, StreamDeskDatabase db)
        {
            if (streamObject.StreamEmbed == "url_browser") {
                webBrowser1.ScrollBarsEnabled = true;
                toolStrip1.Visible = true;
            } else {
                webBrowser1.ScrollBarsEnabled = false;
                toolStrip1.Visible = false;
            }

            viewToolStripMenuItem.Visible = true;
            ActiveStreamObject = streamObject;
            ActiveDatabase = db;

            if (streamObject.ChatEmbed != "none" || streamObject.ChatEmbed != null)
                chatToolStripMenuItem.Visible = true;
            else
                chatToolStripMenuItem.Visible = false;

            Text = streamObject.Name + " > " + streamObject.ProviderObject.Name;

            if (streamObject.StreamEmbed == "url_browser" || streamObject.StreamEmbed == "url_custom")
                webBrowser1.Navigate(streamObject.GetStreamEmbedData("URL"));
            else {
                ClientSize = new Size(streamObject.Size.Width, streamObject.Size.Height);
                webBrowser1.DocumentText = db.GetStream(streamObject);
            }
        }
开发者ID:StreamDesk,项目名称:StreamDesk-old,代码行数:28,代码来源:MainStreamForm.cs

示例12: OnStreamCreated

 public void OnStreamCreated(PublisherKit publisher, Stream stream)
 {
     mStreams.Add(stream);
     if (mSubscriber == null) {
         SubscribeToStream(stream);
     }
 }
开发者ID:ericgla,项目名称:XamarinOpenTok,代码行数:7,代码来源:ConferenceActivity.cs

示例13: Conference

        public Conference(string json_str)
        {
            dynamic json = JObject.Parse(json_str);
            var conference = json["conference"];
            cid = (int)conference["cid"];
            string desc = (string)conference["desc"];
            this.desc = Encoding.GetEncoding("gbk").GetString(Convert.FromBase64String(desc));
            mode = (string)conference["mode"];
            uptime = (double)conference["uptime"];

            Streams = new List<Stream>();
            foreach (var stream in conference["streams"]) {
                Stream s = new Stream();
                s.streamid = stream["streamid"];
                string d = stream["desc"];
                if (d == "audio(iLBC)")
                    s.desc = d;
                else {
                    byte[] raw = Convert.FromBase64String(d);
                    s.desc = Encoding.GetEncoding("gbk").GetString(raw);
                }
                s.stat = new Stream.Stat();
                s.stat.bytes_recv = stream["stat"]["bytes_recv"];
                s.stat.bytes_sent = stream["stat"]["bytes_sent"];
                s.stat.jitter = stream["stat"]["jitter"];
                s.stat.packet_lost_recv = stream["stat"]["packet_lost_recv"];
                s.stat.packet_lost_sent = stream["stat"]["packet_lost_sent"];
                s.stat.packet_recv = stream["stat"]["packet_recv"];
                s.stat.packet_sent = stream["stat"]["packet_sent"];

                Streams.Add(s);
            }

            // TODO:
            Sources = new List<Source>();

            Sinks = new List<Sink>();
            foreach (var sink in conference["sinks"]) {
                Sink s = new Sink();
                s.sinkid = sink["sinkid"];
                string d = sink["desc"];
                if (d == "audio(iLBC)")
                    s.desc = d;
                else {
                    byte[] raw = Convert.FromBase64String(d);
                    s.desc = Encoding.GetEncoding("gbk").GetString(raw);
                }
                d = sink["who"];
                byte[] who_raw = Convert.FromBase64String(d);
                s.who = Encoding.GetEncoding("gbk").GetString(who_raw);
                s.stat = new Sink.Stat();
                s.stat.jitter = sink["stat"]["jitter"];
                s.stat.packets_lost = sink["stat"]["packets_lost"];
                s.stat.packets = sink["stat"]["packets"];
                s.stat.sent = sink["stat"]["sent"];

                Sinks.Add(s);
            }
        }
开发者ID:FihlaTV,项目名称:conference,代码行数:59,代码来源:Conference.cs

示例14: doSerialize

 protected override void doSerialize(Stream stream)
 {
     centerOfMass.serialize(stream);
     stream.write(mass);
     torque.serialize(stream);
     momentumOfInertia.serialize(stream);
     angularMomentum.serialize(stream);
 }
开发者ID:sopindm,项目名称:bjeb,代码行数:8,代码来源:Vessel.cs

示例15: doDeserialize

 protected override void doDeserialize(Stream stream)
 {
     centerOfMass.deserialize(stream);
     mass = stream.readDouble();
     torque.deserialize(stream);
     momentumOfInertia.deserialize(stream);
     angularMomentum.deserialize(stream);
 }
开发者ID:sopindm,项目名称:bjeb,代码行数:8,代码来源:Vessel.cs


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