HttpStream 2.0.50
dotnet add package HttpStream --version 2.0.50
NuGet\Install-Package HttpStream -Version 2.0.50
<PackageReference Include="HttpStream" Version="2.0.50" />
paket add HttpStream --version 2.0.50
#r "nuget: HttpStream, 2.0.50"
// Install HttpStream as a Cake Addin #addin nuget:?package=HttpStream&version=2.0.50 // Install HttpStream as a Cake Tool #tool nuget:?package=HttpStream&version=2.0.50
HttpStream
This C# project implements randomly accessible stream on HTTP 1.1 transport. Typically, HttpClient provides almost all HTTP features but it just provides us with a way to download a file completely. The implementation take advantage of HTTP 1.1 range access or on fallback case, it uses HTTP/1.0 sequential download anyway.
Source Code
The source code is available at GitHub.
NuGet Package
A prebuilt NuGet package is available: HttpStream.
To install HttpStream, run the following command in the Package Manager Console:
PM> Install-Package HttpStream
Supported Platforms
This module is built against .NET Platform Standard 1.6 (netstandard1.6
) and it's compatible with the following platforms:
- .NET Core 1.0
- .NET Framework 4.6.1
- Universal Windows Platform 10.0.16299
- Mono 4.6
- Xamarin.iOS 10.0
- Xamarin.Mac 3.0
- Xamarin.Android 7.0
For more information, see the illustration on Mapping the .NET Platform Standard to platforms - .NET Platform Standard.
Simple Usage
using Espresso3389.HttpStream;
// cache stream
var fs = File.Create("cache.jpg");
// The third parameter, true indicates that the httpStream will close the cache stream.
var uri = new Uri(@"https://dl.dropboxusercontent.com/u/150906/2007-01-28%2006.04.05.JPG");
var cacheSize = 1024 * 64;
var httpStream = new HttpStream.HttpStream(uri, fs, true, cacheSize, null);
// RangeDownloaded is called on every incremental download
httpStream.RangeDownloaded += (sender, e) =>
{
Console.WriteLine("Progress: {0}%", (int)(100 * httpStream.CachedRatio));
};
// The following code actually invokes download whole the file
// You can use BufferedStream to improve I/O performance.
var bmp = await BitmapFactory.DecodeStreamAsync(new BufferedStream(httpStream, cacheSize));
License
The codes/binaries are licensed under MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.6 is compatible. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen30 was computed. tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.