• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SqlBytesCharsState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SqlBytesCharsState的典型用法代码示例。如果您正苦于以下问题:C# SqlBytesCharsState类的具体用法?C# SqlBytesCharsState怎么用?C# SqlBytesCharsState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SqlBytesCharsState类属于命名空间,在下文中一共展示了SqlBytesCharsState类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SqlChars

 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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SqlChars.cs


示例2: SqlBytes

 public SqlBytes(System.IO.Stream s)
 {
     this.m_rgbBuf = null;
     this.m_lCurLen = -1L;
     this.m_stream = s;
     this.m_state = (s == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Stream;
     this.m_rgbWorkBuf = null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SqlBytes.cs


示例3: SqlChars

        // 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();
        }
开发者ID:er0dr1guez,项目名称:corefx,代码行数:20,代码来源:SQLChars.cs


示例4: SqlBytes

        // Create a SqlBytes with an in-memory buffer
        public SqlBytes(byte[] buffer)
        {
            _rgbBuf = buffer;
            _stream = null;
            if (_rgbBuf == null)
            {
                _state = SqlBytesCharsState.Null;
                _lCurLen = x_lNull;
            }
            else
            {
                _state = SqlBytesCharsState.Buffer;
                _lCurLen = _rgbBuf.Length;
            }

            _rgbWorkBuf = null;

            AssertValid();
        }
开发者ID:dotnet,项目名称:corefx,代码行数:20,代码来源:SQLBytes.cs


示例5: CopyStreamToBuffer

 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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:20,代码来源:SqlChars.cs


示例6: SqlBytes

		// Create a SqlBytes with an in-memory buffer
		public SqlBytes(byte[] buffer) {
			m_rgbBuf = buffer;
			m_stream = null;
			if (m_rgbBuf == null) {
				m_state = SqlBytesCharsState.Null;
				m_lCurLen = x_lNull;
            }
			else {
				m_state = SqlBytesCharsState.Buffer;
				m_lCurLen = (long)m_rgbBuf.Length;
            }

			m_rgbWorkBuf = null;

			AssertValid();
		}
开发者ID:uQr,项目名称:referencesource,代码行数:17,代码来源:SQLBytes.cs


示例7: CopyStreamToBuffer

		// 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();
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:23,代码来源:SQLChars.cs


示例8: SetLength

		// Set the current length of the data
		// If the SqlChars is Null, setLength will make it non-Null.
		public void SetLength(long value) {
			if (value < 0)
				throw new ArgumentOutOfRangeException("value");

			if (FStream()) {
				m_stream.SetLength(value);
            }
			else {
				// If there is a buffer, even the value of SqlChars is Null,
				// still allow setting length to zero, which will make it not Null.
				// If the buffer is null, raise exception
				//
				if (null == m_rgchBuf)
                    throw new SqlTypeException(Res.GetString(Res.SqlMisc_NoBufferMessage));

				if (value > (long)m_rgchBuf.Length)
					throw new ArgumentOutOfRangeException("value");

				else if (IsNull)
					// At this point we know that value is small enough
					// Go back in buffer mode
					m_state = SqlBytesCharsState.Buffer;
                                
				m_lCurLen = value;
				}

			AssertValid();
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:30,代码来源:SQLChars.cs


示例9: SetBuffer

 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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:SqlChars.cs


示例10: SetBuffer

        private void SetBuffer(byte[] buffer)
        {
            _rgbBuf = buffer;
            _lCurLen = (_rgbBuf == null) ? x_lNull : _rgbBuf.Length;
            _stream = null;
            _state = (_rgbBuf == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Buffer;

            AssertValid();
        }
开发者ID:dotnet,项目名称:corefx,代码行数:9,代码来源:SQLBytes.cs


示例11: CopyStreamToBuffer

        // Copy the data from the Stream to the array buffer.
        // If the SqlBytes doesn't hold a buffer or the buffer
        // is not big enough, allocate new byte array.
        private void CopyStreamToBuffer()
        {
            Debug.Assert(FStream());

            long lStreamLen = _stream.Length;
            if (lStreamLen >= x_lMaxLen)
                throw new SqlTypeException(SR.SqlMisc_WriteOffsetLargerThanLenMessage);

            if (_rgbBuf == null || _rgbBuf.Length < lStreamLen)
                _rgbBuf = new byte[lStreamLen];

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

            _stream.Read(_rgbBuf, 0, (int)lStreamLen);
            _stream = null;
            _lCurLen = lStreamLen;
            _state = SqlBytesCharsState.Buffer;

            AssertValid();
        }
开发者ID:dotnet,项目名称:corefx,代码行数:24,代码来源:SQLBytes.cs


示例12: SqlChars

		// Create a SqlChars from a SqlStreamChars
		internal SqlChars(SqlStreamChars s) {
			m_rgchBuf = null;
			m_lCurLen = x_lNull;
			m_stream = s;
			m_state = (s == null) ? SqlBytesCharsState.Null : SqlBytesCharsState.Stream;

			m_rgchWorkBuf = null;

			AssertValid();
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:11,代码来源:SQLChars.cs


示例13: SetNull

		// --------------------------------------------------------------
		//	  Public methods
		// --------------------------------------------------------------

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

    		AssertValid();
		}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:11,代码来源:SQLChars.cs


示例14: SetLength

 public void SetLength(long value)
 {
     if (value < 0L)
     {
         throw new ArgumentOutOfRangeException("value");
     }
     if (this.FStream())
     {
         this.m_stream.SetLength(value);
     }
     else
     {
         if (this.m_rgchBuf == null)
         {
             throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_NoBufferMessage"));
         }
         if (value > this.m_rgchBuf.Length)
         {
             throw new ArgumentOutOfRangeException("value");
         }
         if (this.IsNull)
         {
             this.m_state = SqlBytesCharsState.Buffer;
         }
         this.m_lCurLen = value;
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:SqlChars.cs


示例15: Write

		// Write data of specified length into the SqlChars from specified offset

		public void Write(long offset, char[] buffer, int offsetInBuffer, int count) {
			if (FStream()) {
				if (m_stream.Position != offset)
					m_stream.Seek(offset, SeekOrigin.Begin);
				m_stream.Write(buffer, offsetInBuffer, count);
            }
			else {
				// Validate the arguments
				if (buffer == null)
					throw new ArgumentNullException("buffer");

				if (m_rgchBuf == null)
                    throw new SqlTypeException(Res.GetString(Res.SqlMisc_NoBufferMessage));

				if (offset < 0)
					throw new ArgumentOutOfRangeException("offset");
				if (offset > m_rgchBuf.Length)
                    throw new SqlTypeException(Res.GetString(Res.SqlMisc_BufferInsufficientMessage));

				if (offsetInBuffer < 0 || offsetInBuffer > buffer.Length)
					throw new ArgumentOutOfRangeException("offsetInBuffer");

				if (count < 0 || count > buffer.Length - offsetInBuffer)
					throw new ArgumentOutOfRangeException("count");

				if (count > m_rgchBuf.Length - offset)
                    throw new SqlTypeException(Res.GetString(Res.SqlMisc_BufferInsufficientMessage));

				if (IsNull) {
					// If NULL and there is buffer inside, we only allow writing from 
					// offset zero.
					//
					if (offset != 0)
                        throw new SqlTypeException(Res.GetString(Res.SqlMisc_WriteNonZeroOffsetOnNullMessage));

					// treat as if our current length is zero.
					// Note this has to be done after all inputs are validated, so that
					// we won't throw exception after this point.
					//
					m_lCurLen = 0;
                    m_state = SqlBytesCharsState.Buffer;
                }
				else if (offset > m_lCurLen) {
					// Don't allow writing from an offset that this larger than current length.
					// It would leave uninitialized data in the buffer.
					//
                    throw new SqlTypeException(Res.GetString(Res.SqlMisc_WriteOffsetLargerThanLenMessage));
				}

				if (count != 0)	{
					Array.Copy(buffer, offsetInBuffer, m_rgchBuf, offset, count);

					// If the last position that has been written is after
					// the current data length, reset the length
					if (m_lCurLen < offset + count)
						m_lCurLen = offset + count;
                }
            }

			AssertValid();
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:63,代码来源:SQLChars.cs


示例16: SetNull

 public void SetNull()
 {
     this.m_lCurLen = -1L;
     this.m_stream = null;
     this.m_state = SqlBytesCharsState.Null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:6,代码来源:SqlChars.cs


示例17: SetBuffer

		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();
		}
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:8,代码来源:SQLChars.cs


示例18: Write

 public void Write(long offset, char[] buffer, int offsetInBuffer, int count)
 {
     if (this.FStream())
     {
         if (this.m_stream.Position != offset)
         {
             this.m_stream.Seek(offset, SeekOrigin.Begin);
         }
         this.m_stream.Write(buffer, offsetInBuffer, count);
     }
     else
     {
         if (buffer == null)
         {
             throw new ArgumentNullException("buffer");
         }
         if (this.m_rgchBuf == null)
         {
             throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_NoBufferMessage"));
         }
         if (offset < 0L)
         {
             throw new ArgumentOutOfRangeException("offset");
         }
         if (offset > this.m_rgchBuf.Length)
         {
             throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_BufferInsufficientMessage"));
         }
         if ((offsetInBuffer < 0) || (offsetInBuffer > buffer.Length))
         {
             throw new ArgumentOutOfRangeException("offsetInBuffer");
         }
         if ((count < 0) || (count > (buffer.Length - offsetInBuffer)))
         {
             throw new ArgumentOutOfRangeException("count");
         }
         if (count > (this.m_rgchBuf.Length - offset))
         {
             throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_BufferInsufficientMessage"));
         }
         if (this.IsNull)
         {
             if (offset != 0L)
             {
                 throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_WriteNonZeroOffsetOnNullMessage"));
             }
             this.m_lCurLen = 0L;
             this.m_state = SqlBytesCharsState.Buffer;
         }
         else if (offset > this.m_lCurLen)
         {
             throw new SqlTypeException(System.Data.Res.GetString("SqlMisc_WriteOffsetLargerThanLenMessage"));
         }
         if (count != 0)
         {
             Array.Copy(buffer, (long) offsetInBuffer, this.m_rgchBuf, offset, (long) count);
             if (this.m_lCurLen < (offset + count))
             {
                 this.m_lCurLen = offset + count;
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:63,代码来源:SqlChars.cs



注:本文中的SqlBytesCharsState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SqlCeCommand类代码示例发布时间:2022-05-24
下一篇:
C# SqlBuilder类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap