コード例 #1
0
        private static void readHeader <T>(BinaryReader reader, IList <T> items, HeaderCallback <T> readCallback)
        {
            // Count
            int count = BinaryReaderTools.ReadNumber(reader);

            // Items)
            for (int i = 0; i < count; i++)
            {
                string itemAsText = BinaryReaderTools.ReadString(reader);
                T      item       = readCallback(itemAsText);
                items.Add(item);
            }
        }
コード例 #2
0
        private static void ReadHeader <T>(BinaryReader reader, ICollection <T> items, HeaderCallback <T> readCallback)
        {
            // Count
            var count = BinaryReaderTools.ReadNumber(reader);

            // Items
            for (var i = 0; i < count; i++)
            {
                var itemAsText = BinaryReaderTools.ReadString(reader);
                var item       = readCallback(itemAsText);
                items.Add(item);
            }
        }
コード例 #3
0
 /// <summary>
 ///   Read integer which was saved as 1,2 or 4 bytes, according to its size
 /// </summary>
 /// <returns></returns>
 public int ReadNumber()
 {
     return(BinaryReaderTools.ReadNumber(_reader));
 }
コード例 #4
0
        /// <summary>
        ///   Read type
        /// </summary>
        /// <returns></returns>
        public Type ReadType()
        {
            int index = BinaryReaderTools.ReadNumber(_reader);

            return(_types[index]);
        }
コード例 #5
0
        /// <summary>
        ///   Reads property name
        /// </summary>
        /// <returns></returns>
        public string ReadName()
        {
            int index = BinaryReaderTools.ReadNumber(_reader);

            return(_names[index]);
        }