Inheritance: INullable, IDisposable
Beispiel #1
0
 private void SetBuffer(char[] buffer)
 {
     this.m_rgchBuf = buffer;
     this.m_lCurLen = (this.m_rgchBuf == null) ? -1L : ((long)this.m_rgchBuf.Length);
     this.m_stream  = null;
     this.m_state   = (this.m_rgchBuf == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Buffer;
 }
Beispiel #2
0
        // Copy the data from the Stream to the array buffer.
        // If the SqlChars doesn't hold a buffer or the buffer
        // is not big enough, allocate new char array.
        private void CopyStreamToBuffer()
        {
            Debug.Assert(FStream());

            long lStreamLen = m_stream.Length;

            if (lStreamLen >= x_lMaxLen)
            {
                throw new SqlTypeException(Res.GetString(Res.SqlMisc_BufferInsufficientMessage));
            }

            if (m_rgchBuf == null || m_rgchBuf.Length < lStreamLen)
            {
                m_rgchBuf = new char[lStreamLen];
            }

            if (m_stream.Position != 0)
            {
                m_stream.Seek(0, SeekOrigin.Begin);
            }

            m_stream.Read(m_rgchBuf, 0, (int)lStreamLen);
            m_stream = null;
            _lCurLen = lStreamLen;
            _state   = SqlBytesCharsState.Buffer;

            AssertValid();
        }
Beispiel #3
0
        // --------------------------------------------------------------
        //	  Public methods
        // --------------------------------------------------------------

        public void SetNull()
        {
            _lCurLen = x_lNull;
            m_stream = null;
            _state   = SqlBytesCharsState.Null;

            AssertValid();
        }
 internal SqlChars(SqlStreamChars s)
 {
     this.m_rgchBuf = null;
     this.m_lCurLen = -1L;
     this.m_stream = s;
     this.m_state = (s == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Stream;
     this.m_rgchWorkBuf = null;
 }
Beispiel #5
0
 internal SqlChars(SqlStreamChars s)
 {
     this.m_rgchBuf     = null;
     this.m_lCurLen     = -1L;
     this.m_stream      = s;
     this.m_state       = (s == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Stream;
     this.m_rgchWorkBuf = null;
 }
Beispiel #6
0
        private void SetBuffer(char[] buffer)
        {
            _rgchBuf = buffer;
            _lCurLen = (_rgchBuf == null) ? x_lNull : _rgchBuf.Length;
            _stream  = null;
            _state   = (_rgchBuf == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Buffer;

            AssertValid();
        }
Beispiel #7
0
        private void SetBuffer(char[] buffer)
        {
            m_rgchBuf = buffer;
            m_lCurLen = (m_rgchBuf == null) ? x_lNull : (long)m_rgchBuf.Length;
            m_stream  = null;
            m_state   = (m_rgchBuf == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Buffer;

            AssertValid();
        }
Beispiel #8
0
        // Create a SqlChars from a SqlStreamChars
        internal SqlChars(SqlStreamChars s)
        {
            m_rgchBuf = null;
            _lCurLen  = x_lNull;
            m_stream  = s;
            _state    = (s == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Stream;

            _rgchWorkBuf = null;

            AssertValid();
        }
Beispiel #9
0
        // Create a SqlChars from a SqlStreamChars
        internal SqlChars(SqlStreamChars s)
        {
            m_rgchBuf = null;
            _lCurLen = x_lNull;
            m_stream = s;
            _state = (s == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Stream;

            _rgchWorkBuf = null;

            AssertValid();
        }
 public SqlChars(char[] buffer)
 {
     this.m_rgchBuf = buffer;
     this.m_stream = null;
     if (this.m_rgchBuf == null)
     {
         this.m_state = SqlBytesCharsState.Null;
         this.m_lCurLen = -1L;
     }
     else
     {
         this.m_state = SqlBytesCharsState.Buffer;
         this.m_lCurLen = this.m_rgchBuf.Length;
     }
     this.m_rgchWorkBuf = null;
 }
Beispiel #11
0
 private SqlChars(SerializationInfo info, StreamingContext context)
 {
     this.m_stream      = null;
     this.m_rgchWorkBuf = null;
     if (info.GetBoolean("IsNull"))
     {
         this.m_state   = SqlBytesCharsState.Null;
         this.m_rgchBuf = null;
     }
     else
     {
         this.m_state   = SqlBytesCharsState.Buffer;
         this.m_rgchBuf = (char[])info.GetValue("data", typeof(char[]));
         this.m_lCurLen = this.m_rgchBuf.Length;
     }
 }
Beispiel #12
0
 public SqlChars(char[] buffer)
 {
     this.m_rgchBuf = buffer;
     this.m_stream  = null;
     if (this.m_rgchBuf == null)
     {
         this.m_state   = SqlBytesCharsState.Null;
         this.m_lCurLen = -1L;
     }
     else
     {
         this.m_state   = SqlBytesCharsState.Buffer;
         this.m_lCurLen = this.m_rgchBuf.Length;
     }
     this.m_rgchWorkBuf = null;
 }
 private SqlChars(SerializationInfo info, StreamingContext context)
 {
     this.m_stream = null;
     this.m_rgchWorkBuf = null;
     if (info.GetBoolean("IsNull"))
     {
         this.m_state = SqlBytesCharsState.Null;
         this.m_rgchBuf = null;
     }
     else
     {
         this.m_state = SqlBytesCharsState.Buffer;
         this.m_rgchBuf = (char[]) info.GetValue("data", typeof(char[]));
         this.m_lCurLen = this.m_rgchBuf.Length;
     }
 }
Beispiel #14
0
        // Create a SqlChars with an in-memory buffer
        public SqlChars(char[] buffer)
        {
            m_rgchBuf = buffer;
            m_stream = null;
            if (m_rgchBuf == null)
            {
                _state = SqlBytesCharsState.Null;
                _lCurLen = x_lNull;
            }
            else
            {
                _state = SqlBytesCharsState.Buffer;
                _lCurLen = (long)m_rgchBuf.Length;
            }

            _rgchWorkBuf = null;

            AssertValid();
        }
Beispiel #15
0
        // Create a SqlChars with an in-memory buffer
        public SqlChars(char[] buffer)
        {
            m_rgchBuf = buffer;
            m_stream  = null;
            if (m_rgchBuf == null)
            {
                _state   = SqlBytesCharsState.Null;
                _lCurLen = x_lNull;
            }
            else
            {
                _state   = SqlBytesCharsState.Buffer;
                _lCurLen = (long)m_rgchBuf.Length;
            }

            _rgchWorkBuf = null;

            AssertValid();
        }
Beispiel #16
0
        private void CopyStreamToBuffer()
        {
            long length = this.m_stream.Length;

            if (length >= 0x7fffffffL)
            {
                throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_BufferInsufficientMessage"));
            }
            if ((this.m_rgchBuf == null) || (this.m_rgchBuf.Length < length))
            {
                this.m_rgchBuf = new char[length];
            }
            if (this.m_stream.Position != 0L)
            {
                this.m_stream.Seek(0L, SeekOrigin.Begin);
            }
            this.m_stream.Read(this.m_rgchBuf, 0, (int)length);
            this.m_stream  = null;
            this.m_lCurLen = length;
            this.m_state   = SqlBytesCharsState.Buffer;
        }
		// --------------------------------------------------------------
		//	  Public methods
		// --------------------------------------------------------------

		public void SetNull() {
    		m_lCurLen = x_lNull;
    		m_stream = null;
    		m_state = SqlBytesCharsState.Null;

    		AssertValid();
		}
 private void CopyStreamToBuffer()
 {
     long length = this.m_stream.Length;
     if (length >= 0x7fffffffL)
     {
         throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_BufferInsufficientMessage"));
     }
     if ((this.m_rgchBuf == null) || (this.m_rgchBuf.Length < length))
     {
         this.m_rgchBuf = new char[length];
     }
     if (this.m_stream.Position != 0L)
     {
         this.m_stream.Seek(0L, SeekOrigin.Begin);
     }
     this.m_stream.Read(this.m_rgchBuf, 0, (int) length);
     this.m_stream = null;
     this.m_lCurLen = length;
     this.m_state = SqlBytesCharsState.Buffer;
 }
Beispiel #19
0
 public void SetNull()
 {
     this.m_lCurLen = -1L;
     this.m_stream  = null;
     this.m_state   = SqlBytesCharsState.Null;
 }
		// Copy the data from the Stream to the array buffer.
		// If the SqlChars doesn't hold a buffer or the buffer
		// is not big enough, allocate new char array.
		private void CopyStreamToBuffer() {
			Debug.Assert(FStream());

			long lStreamLen = m_stream.Length;
			if (lStreamLen >= x_lMaxLen)
                           throw new SqlTypeException(Res.GetString(Res.SqlMisc_BufferInsufficientMessage));

			if (m_rgchBuf == null || m_rgchBuf.Length < lStreamLen)
				m_rgchBuf = new char[lStreamLen];

			if (m_stream.Position != 0)
				m_stream.Seek(0, SeekOrigin.Begin);

			m_stream.Read(m_rgchBuf, 0, (int)lStreamLen);
			m_stream = null;
			m_lCurLen = lStreamLen;
			m_state = SqlBytesCharsState.Buffer;

			AssertValid();
        }
 public void SetNull()
 {
     this.m_lCurLen = -1L;
     this.m_stream = null;
     this.m_state = SqlBytesCharsState.Null;
 }
 private void SetBuffer(char[] buffer)
 {
     this.m_rgchBuf = buffer;
     this.m_lCurLen = (this.m_rgchBuf == null) ? -1L : ((long) this.m_rgchBuf.Length);
     this.m_stream = null;
     this.m_state = (this.m_rgchBuf == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Buffer;
 }
Beispiel #23
0
        private void SetBuffer(char[] buffer)
        {
            _rgchBuf = buffer;
            _lCurLen = (_rgchBuf == null) ? x_lNull : _rgchBuf.Length;
            _stream = null;
            _state = (_rgchBuf == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Buffer;

            AssertValid();
        }
		private void SetBuffer(char[] buffer) {
			m_rgchBuf = buffer;
			m_lCurLen = (m_rgchBuf == null) ? x_lNull : (long)m_rgchBuf.Length;
			m_stream = null;
			m_state = (m_rgchBuf == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Buffer;

			AssertValid();
		}
		public SqlChars (SqlStreamChars s)
		{
			notNull = true;
		}