예제 #1
0
 public int CompareTo(object obj)
 {
     if (obj is FileGap)
     {
         FileGap temp = (FileGap)obj;
         return(m_start.CompareTo(temp.m_start));
     }
     throw new ArgumentException("object is not a FileGap");
 }
예제 #2
0
        public GapBuffer(byte[] raw_buffer, int size)
        {
            BinaryReader br      = new BinaryReader(new MemoryStream(raw_buffer));
            int          bufsize = size / (2 * sizeof(Int64));

            m_buffer = new FileGap[bufsize];
            for (int i = 0; i < bufsize; i++)
            {
                m_buffer[i]         = new FileGap();
                m_buffer[i].m_start = System.Net.IPAddress.NetworkToHostOrder(br.ReadInt64());
                m_buffer[i].m_end   = System.Net.IPAddress.NetworkToHostOrder(br.ReadInt64());
            }
            System.Array.Sort(m_buffer);
        }