예제 #1
0
        internal byte[] WriteBinary()
        {
            MemoryStream ms = new MemoryStream();
            BinaryWriter bw = new BinaryWriter(ms);

            bw.Write(MajorVersion);
            bw.Write(MinorVersion);
            bw.Write((int)Flags);
            byte[] header = Header.WriteBinary();
            bw.Write((uint)header.Length);
            bw.Write(header);
            bw.Write(Verifier.WriteBinary());

            bw.Flush();
            return(ms.ToArray());
        }
예제 #2
0
        internal byte[] WriteBinary()
        {
            using (var ms = RecyclableMemory.GetStream())
            {
                BinaryWriter bw = new BinaryWriter(ms);

                bw.Write(MajorVersion);
                bw.Write(MinorVersion);
                bw.Write((int)Flags);
                byte[] header = Header.WriteBinary();
                bw.Write((uint)header.Length);
                bw.Write(header);
                bw.Write(Verifier.WriteBinary());

                bw.Flush();
                return(ms.ToArray());
            }
        }