public void Write(IDictionary dict, ref byte[] buffer, ref int totallength)
{
Values = new Hashtable(dict);
buffer = new byte[0];
totallength = 0;
foreach (object k in dict.Keys)
{
int linelength = 0;
byte[] key = Encoding.ASCII.GetBytes((string) k);
byte[] val = Encoding.ASCII.GetBytes(dict[k].ToString());
totallength += val.Length + key.Length + 1 + 4;
linelength = val.Length + key.Length + 1;
buffer = concat(buffer, ByteLength(linelength));
buffer = concat(buffer, key);
buffer = concat(buffer, Encoding.ASCII.GetBytes("="));
buffer = concat(buffer, val);
}
if (totallength != buffer.Length)
throw new Exception("HEADER AIN'T WRITE GOOD! SHOULD'VE STAYED IN SCHOOL!");
}