예제 #1
0
        public override bool Equals(object obj)
        {
            if (!obj.GetType().Equals(this.GetType()))
            {
                return(false);
            }

            UOPIndexBlockHeader objCurrent = (UOPIndexBlockHeader)obj;

            if (m_Files != objCurrent.m_Files)
            {
                return(false);
            }

            if (m_OffsetNextIndex != objCurrent.m_OffsetNextIndex)
            {
                return(false);
            }

            if (m_ListData.Count != objCurrent.m_ListData.Count)
            {
                return(false);
            }

            for (int i = 0; i < m_ListData.Count; i++)
            {
                if (!m_ListData[i].Equals(objCurrent.m_ListData[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
예제 #2
0
        public static UOPFile FromBinary(System.IO.BinaryReader bStream)
        {
            UOPFile toReturn = new UOPFile();

            toReturn.m_Header = UOPGeneralHeader.FromBinary(bStream);

            bool repeatRead = true;

            while (repeatRead)
            {
                UOPIndexBlockHeader uopIBHCurrent = UOPIndexBlockHeader.FromBinary(bStream);
                toReturn.m_Content.Add(uopIBHCurrent);

                if (uopIBHCurrent.m_OffsetNextIndex == 0)
                {
                    repeatRead = false;
                }
                else
                {
                    bStream.BaseStream.Seek((long)(uopIBHCurrent.m_OffsetNextIndex), System.IO.SeekOrigin.Begin);
                }
            }

            return(toReturn);
        }
예제 #3
0
        public static UOPIndexBlockHeader FromBinary(System.IO.BinaryReader bStream)
        {
            UOPIndexBlockHeader toReturn = new UOPIndexBlockHeader();

            toReturn.m_Files           = bStream.ReadUInt32();
            toReturn.m_OffsetNextIndex = bStream.ReadUInt64();

            for (uint iData = 0; iData < toReturn.m_Files; iData++)
            {
                UOPFileIndexDef uopIndextemp = UOPFileIndexDef.FromBinary(bStream);

                long oldPos = bStream.BaseStream.Position;
                bStream.BaseStream.Seek((long)(uopIndextemp.m_OffsetOfDataBlock), System.IO.SeekOrigin.Begin);

                UOPFileData uopDatatemp = UOPFileData.FromBinary(bStream, uopIndextemp.m_LenghtCompressed);

                toReturn.m_ListData.Add(new UOPPairData(uopIndextemp, uopDatatemp));
                bStream.BaseStream.Seek(oldPos, System.IO.SeekOrigin.Begin);
            }

            return(toReturn);
        }
예제 #4
0
 public void Delete(UOPIndexBlockHeader toDelete)
 {
     for (int i = 0; i < UopFile.m_Content.Count; i++)
     {
         if (toDelete.Equals(UopFile.m_Content[i]))
         {
             UopFile.m_Content.RemoveAt(i);
         }
     }
 }
예제 #5
0
        public static UOPIndexBlockHeader FromBinary(System.IO.BinaryReader bStream)
        {
            UOPIndexBlockHeader toReturn = new UOPIndexBlockHeader();

            toReturn.m_Files = bStream.ReadUInt32();
            toReturn.m_OffsetNextIndex = bStream.ReadUInt64();

            for (uint iData = 0; iData < toReturn.m_Files; iData++)
            {
                UOPFileIndexDef uopIndextemp = UOPFileIndexDef.FromBinary(bStream);

                long oldPos = bStream.BaseStream.Position;
                bStream.BaseStream.Seek((long)(uopIndextemp.m_OffsetOfDataBlock), System.IO.SeekOrigin.Begin);

                UOPFileData uopDatatemp = UOPFileData.FromBinary(bStream, uopIndextemp.m_LenghtCompressed);

                toReturn.m_ListData.Add(new UOPPairData(uopIndextemp, uopDatatemp));
                bStream.BaseStream.Seek(oldPos, System.IO.SeekOrigin.Begin);
            }

            return toReturn;
        }