GithubHelp home page GithubHelp logo

imclab / combination-stream Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook-csharp-sdk/combination-stream

0.0 2.0 0.0 60 KB

Single stream representing multiple streams

License: Apache License 2.0

combination-stream's Introduction

Combination Stream

Allows multiple streams to be represented as a single stream. Only reading stream (both synchronous and asynchronous) is supported.

NuGet

Install-Package CombinationStream

CombinationStream is only distrubuted via nuget as a single CombinationStream.cs file. For those using older versions of Visual Studio that does not support NuGet Package Manager, please download the command line version of NuGet.exe and run the following command.

nuget install CombinationStream

Supported Platforms

  • .NET 2.0+ (client profiles also supported)
  • Windows 8 Metro Style Applications - WinRT (Windows 8)
  • Silverlight 4+
  • Windows Phone 7.0+
  • Portable Class Library

NETFX_CORE must be defined for Windows 8 Metro Style Applications

Usage

Stream stream0 = .....;
Stream stream1 = .....;

var streams = new List<Stream>();
streams.Add(stream0);
streams.Add(stream1);

Stream combinationStream = new CombinationStream(streams);

You can get the internal list of streams using InteralStreams property.

IList<Stream> streams = combinationStream.InternalStreams;

When calling combinationStream.Dispose() all streams will be disposed. If you want to have explict control over disposing certain streams, you can make use of the overload contructor and pass the list of stream index that you would like to auto dispose when calling Dispose() on the CombinationStream.

Stream stream0 = .....;
Stream stream1 = .....;
Stream stream2 = .....;

var streams = new List<Stream>();
streams.Add(stream0);
streams.Add(stream1);
streams.Add(stream2);

Stream combinationStream = new CombinationStream(streams, new [] { 0, 2 });
combinationStream.Dispose(); // disposes only stream at index 0 and 2.
stream1.Dispose(); // need to explicitly dispose stream at index 1

combination-stream's People

Contributors

prabirshrestha avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.