using System; using System.Collections.Generic; using System.IO; using System.Text; namespace Apewer.Network { /// <summary>HTTP 正文。</summary> public abstract class HttpBody { } /// <summary>HTTP 报文结构。</summary> public sealed class HttpBytesMessage : HttpBody { /// <summary>主体。</summary> public byte[] Bytes { get; set; } } /// <summary>HTTP 报文结构。</summary> public class HttpStreamMessage<T> : HttpBody where T : Stream { /// <summary>自动释放 Stream 对象。</summary> public bool AutoDispose { get; set; } /// <summary>主体。</summary> public Stream Stream { get; set; } /// <summary>主体的长度。</summary> public long Length { get; set; } } /// <summary>HTTP 报文结构。</summary> public sealed class HttpStreamMessage : HttpBody { /// <summary>自动释放 Stream 对象。</summary> public bool AutoDispose { get; set; } /// <summary>主体。</summary> public Stream Stream { get; set; } /// <summary>主体的长度。</summary> public long Length { get; set; } } }