Deserialize() public static method

Deserialize a container from binary format, as written by the Serialize method minus the first 32 bits giving the cardinality.
public static Deserialize ( BinaryReader reader, int cardinality ) : BitsetContainer
reader System.IO.BinaryReader The reader to deserialize from.
cardinality int
return BitsetContainer
Beispiel #1
0
        /// <summary>
        /// Deserialize a container from a binary reader.
        /// </summary>
        /// <param name="reader"></param>
        /// <returns>The next container represented by the reader.</returns>
        /// <remarks>The binary format for deserialization is the format written by the Serialize method.</remarks>
        public static Container Deserialize(BinaryReader reader)
        {
            int cardinality = reader.ReadInt32();

            if (cardinality < ArrayContainer.DEFAULT_MAX_SIZE)
            {
                return(ArrayContainer.Deserialize(reader, cardinality));
            }

            return(BitsetContainer.Deserialize(reader, cardinality));
        }