예제 #1
0
        private object Deserialize(ref SerializationReader mySerializationReader, DirectoryEntry myDirectoryEntry)
        {
            try
            {

                #region Read the Inlinedata

                myDirectoryEntry._InlineData = mySerializationReader.ReadByteArray();

                #endregion

                #region Read the INodePositions

                var _NumOfINodePositions = mySerializationReader.ReadUInt32();

                if (_NumOfINodePositions > 0)
                {
                    for (var j = 0UL; j < _NumOfINodePositions; j++)
                    {
                        StorageUUID ID = new StorageUUID();
                        ID.Deserialize(ref mySerializationReader);
                        myDirectoryEntry._INodePositions.Add(new ExtendedPosition(ID, mySerializationReader.ReadUInt64()));
                    }
                }

                #endregion

                #region Read the ObjectStreamsList

                var _NumberOfObjectStreamTypes = mySerializationReader.ReadUInt32();

                if (_NumberOfObjectStreamTypes > 0)
                {
                    for (var j = 0UL; j < _NumberOfObjectStreamTypes; j++)
                        myDirectoryEntry._ObjectStreamsList.Add(mySerializationReader.ReadString());
                }

                #endregion

            }

            catch (GraphFSException e)
            {
                throw new GraphFSException("DirectoryEntry could not be deserialized!\n\n" + e);
            }

            myDirectoryEntry.isDirty = true;

            return myDirectoryEntry;
        }
예제 #2
0
        private object Deserialize(ref SerializationReader mySerializationReader, DirectoryEntry myDirectoryEntry)
        {
            try
            {

                #region Read the Inlinedata

                myDirectoryEntry._InlineData = mySerializationReader.ReadByteArray();

                #region Estimated Size

                if (myDirectoryEntry._InlineData != null)
                {
                    myDirectoryEntry._estimatedSize += Convert.ToUInt64(myDirectoryEntry._InlineData.Length) * EstimatedSizeConstants.Byte;
                }

                #endregion

                #endregion

                #region Read the INodePositions

                #region Estimated Size

                myDirectoryEntry._estimatedSize += EstimatedSizeConstants.HashSet;

                #endregion

                var _NumOfINodePositions = mySerializationReader.ReadUInt32();

                if (_NumOfINodePositions > 0)
                {
                    for (var j = 0UL; j < _NumOfINodePositions; j++)
                    {
                        StorageUUID ID = new StorageUUID();
                        ID.Deserialize(ref mySerializationReader);
                        myDirectoryEntry._INodePositions.Add(new ExtendedPosition(ID, mySerializationReader.ReadUInt64()));

                        #region Estimated Size

                        myDirectoryEntry._estimatedSize += EstimatedSizeConstants.ExtendedPosition;

                        #endregion

                    }
                }

                #endregion

                #region Read the ObjectStreamsList

                #region Estimated Size

                myDirectoryEntry._estimatedSize += EstimatedSizeConstants.HashSet;

                #endregion

                var _NumberOfObjectStreamTypes = mySerializationReader.ReadUInt32();

                if (_NumberOfObjectStreamTypes > 0)
                {
                    for (var j = 0UL; j < _NumberOfObjectStreamTypes; j++)
                    {
                        myDirectoryEntry._ObjectStreamsList.Add(mySerializationReader.ReadString());

                        #region Estimated Size

                        myDirectoryEntry._estimatedSize += EstimatedSizeConstants.Char * EstimatedSizeConstants.EstimatedObjectStreamNameLength;

                        #endregion

                    }
                }

                #endregion

            }

            catch (GraphFSException e)
            {
                throw new GraphFSException("DirectoryEntry could not be deserialized!\n\n" + e);
            }

            myDirectoryEntry.isDirty = true;

            return myDirectoryEntry;
        }
예제 #3
0
 public StorageUUID(StorageUUID myStorageUUID)
     : this(myStorageUUID._UUID)
 {
 }
예제 #4
0
 public new object Clone()
 {
     var newUUID = new StorageUUID(_UUID);
     return newUUID;
 }
예제 #5
0
 public AStorageEngine()
 {
     _StorageUUID = StorageUUID.NewUUID;
     _Description = "";
 }