You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
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; }
|
|
|
|
}
|
|
|
|
}
|
|
|