natix.CompactDS.IEncoder64GenericIO.Save C# (CSharp) Method

Save() public static method

Saves "coder" to the binary file "Output"
public static Save ( BinaryWriter Output, IIEncoder64 coder ) : void
Output System.IO.BinaryWriter
coder IIEncoder64
return void
        public static void Save(BinaryWriter Output, IIEncoder64 coder)
        {
            var type = coder.GetType ();
            byte idType = 255;
            for (byte i = 0; i < Catalog.Count; i++) {
                if (type == Catalog [i]) {
                    idType = i;
                    break;
                }
            }
            if (idType == 255) {
                var s = String.Format ("Type {0} is not a recognized IIEncoder64, please add it to " +
                    "IntegerEncoderGenericIO.Catalog", type);
                throw new ArgumentException (s);
            }
            Output.Write (idType);
            coder.Save (Output);
        }
IEncoder64GenericIO