jellyfin-server/MediaBrowser.Api/Playback/StaticRemoteStreamWriter.cs

47 lines
1.2 KiB
C#
Raw Normal View History

using MediaBrowser.Common.Net;
using ServiceStack.Web;
2013-05-17 18:05:49 +00:00
using System.Collections.Generic;
using System.IO;
namespace MediaBrowser.Api.Playback
{
/// <summary>
/// Class StaticRemoteStreamWriter
/// </summary>
public class StaticRemoteStreamWriter : IStreamWriter, IHasOptions
{
/// <summary>
/// The _input stream
/// </summary>
private readonly HttpResponseInfo _response;
2013-05-17 18:05:49 +00:00
/// <summary>
/// The _options
/// </summary>
private readonly IDictionary<string, string> _options = new Dictionary<string, string>();
public StaticRemoteStreamWriter(HttpResponseInfo response)
2013-05-17 18:05:49 +00:00
{
_response = response;
2013-05-17 18:05:49 +00:00
}
/// <summary>
/// Gets the options.
/// </summary>
/// <value>The options.</value>
public IDictionary<string, string> Options
{
get { return _options; }
}
/// <summary>
/// Writes to.
/// </summary>
/// <param name="responseStream">The response stream.</param>
public void WriteTo(Stream responseStream)
{
2014-10-23 04:26:01 +00:00
_response.Content.CopyTo(responseStream, 819200);
2013-05-17 18:05:49 +00:00
}
}
}