Ejemplo n.º 1
0
 public int Compare(IBlobData a, IBlobData b)
 {
     lock (this)
     {
         if (a.GetId() == b.GetId())
         {
             return(0);
         }
         object[] lobHeader = this.GetLobHeader(a.GetId());
         if (lobHeader == null)
         {
             return(1);
         }
         long num2 = (long)lobHeader[1];
         lobHeader = this.GetLobHeader(b.GetId());
         if (lobHeader == null)
         {
             return(-1);
         }
         long num3 = (long)lobHeader[1];
         if (num2 > num3)
         {
             return(1);
         }
         if (num2 < num3)
         {
             return(-1);
         }
         return(this.CompareBytes(a.GetId(), b.GetId()));
     }
 }
Ejemplo n.º 2
0
        public int Compare(IBlobData a, byte[] b)
        {
            int num;

            lock (this)
            {
                long    num2     = (long)this.GetLobHeader(a.GetId())[1];
                int[][] numArray = this.GetBlockAddresses(a.GetId(), 0, 0x7fffffff);
                int     index    = 0;
                int     num4     = 0;
                int     num5     = 0;
                do
                {
                    int    blockAddress = numArray[index][0] + num5;
                    byte[] blockBytes   = this._lobStore.GetBlockBytes(blockAddress, 1);
                    for (int i = 0; i < blockBytes.Length; i++)
                    {
                        if ((num4 + i) >= b.Length)
                        {
                            goto Label_00A3;
                        }
                        if (blockBytes[i] != b[num4 + i])
                        {
                            return(((blockBytes[i] & 0xff) > (b[num4 + i] & 0xff)) ? 1 : -1);
                        }
                    }
                    num5++;
                    num4 += this._lobBlockSize;
                    if (num5 == numArray[index][1])
                    {
                        num5 = 0;
                        index++;
                    }
                }while (index != numArray.Length);
                goto Label_00DC;
Label_00A3:
                if (num2 == b.Length)
                {
                    return(0);
                }
                return(1);

Label_00DC:
                num = -1;
            }
            return(num);
        }
Ejemplo n.º 3
0
 protected override void WriteBlob(IBlobData o, SqlType type)
 {
     this.WriteLong(o.GetId());
 }