コード例 #1
0
ファイル: TermWriter.cs プロジェクト: gregorypilar/interlace
        public static byte[] TermToBinary(object term)
        {
            MemoryStream stream = new MemoryStream();

            using (TermWriter writer = new TermWriter(stream))
            {
                writer.WriteTerm(term);

                return stream.ToArray();
            }
        }
コード例 #2
0
        public void SendTerm(object term)
        {
            using (MemoryStream stream = PrepareSendFrame())
            {
                using (TermWriter writer = new TermWriter(stream))
                {
                    writer.WriteTerm(term);

                    CompleteSendFrame(stream);
                }
            }
        }