public Result GetChars(Session session, long lobId, long offset, int length) { lock (this) { Result result2 = this.GetBytes(lobId, offset * 2L, length * 2); if (result2.IsError()) { return(result2); } char[] chars = ArrayUtil.ByteArrayToChars(((ResultLob)result2).GetByteArray()); return(ResultLob.NewLobGetCharsResponse(lobId, offset, chars)); } }
public int CompareText(long aId, long bId) { lock (this) { long num2 = (long)this.GetLobHeader(aId)[1]; long num3 = (long)this.GetLobHeader(bId)[1]; int[][] numArray = this.GetBlockAddresses(aId, 0, 0x7fffffff); int[][] numArray2 = this.GetBlockAddresses(bId, 0, 0x7fffffff); int index = 0; int num5 = 0; int num6 = 0; int num7 = 0; do { int blockAddress = numArray[index][0] + num6; int num10 = numArray2[num5][0] + num7; byte[] blockBytes = this._lobStore.GetBlockBytes(num10, 1); long num11 = num2 - (((numArray[index][2] + num6) * this._lobBlockSize) / 2); if (num11 > (this._lobBlockSize / 2)) { num11 = this._lobBlockSize / 2; } long num12 = num3 - (((numArray2[num5][2] + num7) * this._lobBlockSize) / 2); if (num12 > (this._lobBlockSize / 2)) { num12 = this._lobBlockSize / 2; } string a = new string(ArrayUtil.ByteArrayToChars(this._lobStore.GetBlockBytes(blockAddress, 1)), 0, (int)num11); string b = new string(ArrayUtil.ByteArrayToChars(blockBytes), 0, (int)num12); int num8 = this._database.collation.Compare(a, b); if (num8 != 0) { return(num8); } num6++; num7++; if (num6 == numArray[index][1]) { num6 = 0; index++; } if (num7 == numArray2[num5][1]) { num7 = 0; num5++; } }while (index != numArray.Length); return(0); } }
public int Compare(IClobData a, string b) { lock (this) { long num2 = (long)this.GetLobHeader(a.GetId())[1]; int[][] numArray = this.GetBlockAddresses(a.GetId(), 0, 0x7fffffff); int index = 0; int startIndex = 0; int num5 = 0; do { int blockAddress = numArray[index][0] + num5; long num8 = num2 - (((numArray[index][2] + num5) * this._lobBlockSize) / 2); if (num8 > (this._lobBlockSize / 2)) { num8 = this._lobBlockSize / 2; } string str = new string(ArrayUtil.ByteArrayToChars(this._lobStore.GetBlockBytes(blockAddress, 1)), 0, (int)num8); int length = b.Length - startIndex; if (length > (this._lobBlockSize / 2)) { length = this._lobBlockSize / 2; } string str2 = b.Substring(startIndex, length); int num6 = this._database.collation.Compare(str, str2); if (num6 != 0) { return(num6); } num5++; startIndex += this._lobBlockSize / 2; if (num5 == numArray[index][1]) { num5 = 0; index++; } }while (index != numArray.Length); return(0); } }