/// Decompresses the given Huffman coded string literal.
/// </summary>
/// <param name="buf">the string literal to be decoded</param>
/// <returns>the output stream for the compressed data</returns>
/// <exception cref="IOException">throws IOException if an I/O error occurs. In particular, an <code>IOException</code> may be thrown if the output stream has been closed.</exception>
publicstringDecode(byte[]buf)
{
varresultBuf=newbyte[buf.Length*2];
intresultSize=0;
varnode=root;
intcurrent=0;
intbits=0;
for(inti=0;i<buf.Length;i++)
{
intb=buf[i];
current=(current<<8)|b;
bits+=8;
while(bits>=8)
{
intc=(current>>(bits-8))&0xFF;
node=node.Children[c];
bits-=node.Bits;
if(node.IsTerminal)
{
if(node.Symbol==HpackUtil.HuffmanEos)
{
thrownewIOException("EOS Decoded");
}
resultBuf[resultSize++]=(byte)node.Symbol;
node=root;
}
}
}
while(bits>0)
{
intc=(current<<(8-bits))&0xFF;
node=node.Children[c];
if(node.IsTerminal&&node.Bits<=bits)
{
bits-=node.Bits;
resultBuf[resultSize++]=(byte)node.Symbol;
node=root;
}
else
{
break;
}
}
// Section 5.2. String Literal Representation
// Padding not corresponding to the most significant bits of the code
// for the EOS symbol (0xFF) MUST be treated as a decoding error.
/// Compresses the input string literal using the Huffman coding.
/// </summary>
/// <param name="output">the output stream for the compressed data</param>
/// <param name="data">the string literal to be Huffman encoded</param>
/// <param name="off">the start offset in the data</param>
/// <param name="len">the number of bytes to encode</param>
/// <exception cref="IOException">if an I/O error occurs. In particular, an <code>IOException</code> may be thrown if the output stream has been closed.</exception>
"keywords":"Class HttpHeader Http Header object used by proxy Inheritance Object HttpHeader Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class HttpHeader Constructors HttpHeader(String, String) Initialize a new instance. Declaration public HttpHeader(string name, string value) Parameters Type Name Description String name Header name. String value Header value. Properties Name Header Name. Declaration public string Name { get; set; } Property Value Type Description String Value Header Value. Declaration public string Value { get; set; } Property Value Type Description String Methods ToString() Returns header as a valid header string. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString()"
"keywords":"Class HttpHeader Http Header object used by proxy Inheritance Object HttpHeader Inherited Members Object.Equals(Object) Object.Equals(Object, Object) Object.ReferenceEquals(Object, Object) Object.GetHashCode() Object.GetType() Object.MemberwiseClone() Namespace : Titanium.Web.Proxy.Models Assembly : Titanium.Web.Proxy.dll Syntax public class HttpHeader Constructors HttpHeader(String, String) Initialize a new instance. Declaration public HttpHeader(string name, string value) Parameters Type Name Description String name Header name. String value Header value. Fields HttpHeaderOverhead HPACK: Header Compression for HTTP/2 Section 4.1. Calculating Table Size The additional 32 octets account for an estimated overhead associated with an entry. Declaration public const int HttpHeaderOverhead = 32 Field Value Type Description Int32 Properties Name Header Name. Declaration public string Name { get; set; } Property Value Type Description String Size Declaration public int Size { get; } Property Value Type Description Int32 Value Header Value. Declaration public string Value { get; set; } Property Value Type Description String Methods SizeOf(String, String) Declaration public static int SizeOf(string name, string value) Parameters Type Name Description String name String value Returns Type Description Int32 ToString() Returns header as a valid header string. Declaration public override string ToString() Returns Type Description String Overrides Object.ToString()"