public static byte[] Encode(object x) { MemoryStream ms = new MemoryStream(); bencode_rec(x, ms); return ms.ToArray(); }