Added a BaseKernel for the UI and Server to share, and made some other minor re-organizations.

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-07-21 14:39:47 -04:00
parent 3f55707755
commit 0a48b5e31a
41 changed files with 255 additions and 397 deletions

View File

@@ -0,0 +1,19 @@
using System;
using System.IO;
using System.Reactive.Linq;
namespace MediaBrowser.Common.Net
{
public static class StreamExtensions
{
public static IObservable<byte[]> ReadBytes(this Stream stream, int count)
{
var buffer = new byte[count];
return Observable.FromAsyncPattern((cb, state) => stream.BeginRead(buffer, 0, count, cb, state), ar =>
{
stream.EndRead(ar);
return buffer;
})();
}
}
}