コード例 #1
0
        /// <inheritdoc />
        public override byte[] GetBytes()
        {
            int Offset = 4;

            byte[] PropertyStore = new byte[StoreSize];
            Buffer.BlockCopy(BitConverter.GetBytes(StoreSize), 0, PropertyStore, 0, 4);
            for (int i = 0; i < this.PropertyStorage.Count; i++)
            {
                SerializedPropertyStorage PropertyStorage = this.PropertyStorage[i];
                Buffer.BlockCopy(PropertyStorage.GetBytes(), 0, PropertyStore, Offset, (int)PropertyStorage.StorageSize);
                Offset += (int)PropertyStorage.StorageSize;
            }
            return(PropertyStore);
        }
コード例 #2
0
        /// <inheritdoc />
        public override byte[] GetBytes()
        {
            int Offset = 8;

            byte[] PropertyStoreDataBlock = new byte[BlockSize];
            Buffer.BlockCopy(BitConverter.GetBytes(BlockSize), 0, PropertyStoreDataBlock, 0, 4);
            Buffer.BlockCopy(BitConverter.GetBytes((UInt32)BlockSignature), 0, PropertyStoreDataBlock, 4, 4);
            for (int i = 0; i < PropertyStore.Count; i++)
            {
                SerializedPropertyStorage PropertyStorage = PropertyStore[i];
                Buffer.BlockCopy(PropertyStorage.GetBytes(), 0, PropertyStoreDataBlock, Offset, (int)PropertyStorage.StorageSize);
                Offset += (int)PropertyStorage.StorageSize;
            }
            return(PropertyStoreDataBlock);
        }