示例#1
0
        public ObjectStream(ILargeObject largeObject)
        {
            if (largeObject == null)
                throw new ArgumentNullException("largeObject");

            this.largeObject = largeObject;
            outTempStream = new MemoryStream(64*1024);

            readBuf = new byte[BufferSize];
            readBufferPos = -1;
        }
 public static SqlLongString Unicode(ILargeObject largeObject)
 {
     return(new SqlLongString(largeObject, Encoding.Unicode));
 }
示例#3
0
 private void WriteToObject(ILargeObject obj, Encoding encoding, string text)
 {
     using (var stream = new ObjectStream(obj)) {
         using (var streamWriter = new StreamWriter(stream, encoding)) {
             streamWriter.Write(text);
             streamWriter.Flush();
         }
     }
 }
示例#4
0
 public override ISqlObject CreateFromLargeObject(ILargeObject objRef)
 {
     return new SqlLongBinary(objRef);
 }
示例#5
0
 public virtual void SetLargeObject(string key, ILargeObject largeObject)
 {
     lobStore[key] = largeObject;
 }
示例#6
0
 public SqlLongBinary(ILargeObject largeObject)
 {
     this.largeObject = largeObject;
 }
示例#7
0
 public virtual ISqlObject CreateFromLargeObject(ILargeObject objRef)
 {
     throw new NotSupportedException(String.Format("SQL Type {0} cannot be created from a large object.", TypeCode));
 }
示例#8
0
 public DirectLargeObjectChannel(ServerConnector connector, ILargeObject obj)
 {
     this.connector = connector;
     this.obj = obj;
 }
 public SqlLongBinary(ILargeObject largeObject)
 {
     this.largeObject = largeObject;
 }
示例#10
0
 public override ISqlObject CreateFromLargeObject(ILargeObject objRef)
 {
     return new SqlLongString(objRef, Encoding);
 }
示例#11
0
 public override void SetLargeObject(string key, ILargeObject largeObject)
 {
     base.SetLargeObject(key, largeObject);
     newLobs.Add(key);
 }
示例#12
0
 public override ISqlObject CreateFromLargeObject(ILargeObject objRef)
 {
     return(new SqlLongBinary(objRef));
 }
示例#13
0
 public override ISqlObject CreateFromLargeObject(ILargeObject objRef)
 {
     return(new SqlLongString(objRef, Encoding));
 }
示例#14
0
            private void Dispose(bool disposing)
            {
                if (disposing) {
                    connector.DisposeChannel(obj.Id);
                }

                connector = null;
                obj = null;
            }
示例#15
0
 public static SqlLongString Ascii(ILargeObject largeObject)
 {
     return(new SqlLongString(largeObject, Encoding.ASCII));
 }
示例#16
0
 public DirectLargeObjectChannel(ServerConnector connector, ILargeObject obj)
 {
     this.connector = connector;
     this.obj       = obj;
 }
示例#17
0
 public SqlLongString(ILargeObject largeObject, Encoding encoding)
     : this(largeObject, encoding, false)
 {
 }
示例#18
0
 public static T LoadFromLargeObject <T>(this ILargeObject lg)
 {
     return(lg.Convert <T>());
 }