Ejemplo n.º 1
0
        /// <summary>
        /// Release all resources
        /// </summary>
        public override void Dispose()
        {
            base.Dispose();

            if (ToWriteStream != null)
            {
                //Type table
                IWriter typeTableWriter = new BinaryWriterProxy(ToWriteStream);
                WriteTypeTable(typeTableWriter);

                //Data
                byte[] arr = InnerStream.ToArray();
                ToWriteStream.Write(arr, 0, arr.Length);
            }

            InnerStream?.Dispose();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="toWrite">Stream to write into</param>
 public StreamBinarySimpleWriter(Stream toWrite)
 {
     Writer = new BinaryWriterProxy(toWrite);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Ctor
 /// </summary>
 protected StreamBinaryObjectWriter()
 {
     InnerStream = new MemoryStream();
     Writer      = new BinaryWriterProxy(InnerStream);
 }