Espresso3389.HttpStream 2.0.52.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package Espresso3389.HttpStream --version 2.0.52.3
NuGet\Install-Package Espresso3389.HttpStream -Version 2.0.52.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Espresso3389.HttpStream" Version="2.0.52.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Espresso3389.HttpStream --version 2.0.52.3
#r "nuget: Espresso3389.HttpStream, 2.0.52.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Espresso3389.HttpStream as a Cake Addin
#addin nuget:?package=Espresso3389.HttpStream&version=2.0.52.3

// Install Espresso3389.HttpStream as a Cake Tool
#tool nuget:?package=Espresso3389.HttpStream&version=2.0.52.3

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Espresso3389.HttpStream:

Repository Stars
Mongo2Go/Mongo2Go
Mongo2Go - MongoDB for .NET integration tests
Version Downloads Last updated
2.0.68 205 2/8/2024
2.0.52.3 1,511 2/20/2019
2.0.37 1,876 7/26/2016
2.0.33 1,302 7/26/2016
2.0.32 1,293 7/26/2016
2.0.22 1,419 7/12/2016

b40684a