Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / Data / Microsoft / SqlServer / Server / SmiGettersStream.cs / 1 / SmiGettersStream.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace Microsoft.SqlServer.Server { using System; using System.Data.Common; using System.Data.SqlClient; using System.IO; using System.Diagnostics; internal class SmiGettersStream : Stream { private SmiEventSink_Default _sink; private ITypedGettersV3 _getters; private int _ordinal; private long _readPosition; private SmiMetaData _metaData; internal SmiGettersStream( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) { Debug.Assert( null != sink ); Debug.Assert( null != getters ); Debug.Assert( 0 <= ordinal ); Debug.Assert( null != metaData ); _sink = sink; _getters = getters; _ordinal = ordinal; _readPosition = 0; _metaData = metaData; } public override bool CanRead { get { return true; } } // If CanSeek is false, Position, Seek, Length, and SetLength should throw. public override bool CanSeek { get { return false; } } public override bool CanWrite { get { return false; } } public override long Length { get { return ValueUtilsSmi.GetBytesInternal( _sink, _getters, _ordinal, _metaData, 0, null, 0, 0, false ); } } public override long Position { get { return _readPosition; } set { throw SQL.StreamSeekNotSupported(); } } public override void Flush() { throw SQL.StreamWriteNotSupported(); } public override long Seek(long offset, SeekOrigin origin) { throw SQL.StreamSeekNotSupported(); } public override void SetLength(long value) { throw SQL.StreamWriteNotSupported(); } public override int Read( byte[] buffer, int offset, int count ) { long bytesRead = ValueUtilsSmi.GetBytesInternal( _sink, _getters, _ordinal, _metaData, _readPosition, buffer, offset, count, false ); _readPosition += bytesRead; return checked( (int) bytesRead ); } public override void Write( byte[] buffer, int offset, int count ) { throw SQL.StreamWriteNotSupported(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace Microsoft.SqlServer.Server { using System; using System.Data.Common; using System.Data.SqlClient; using System.IO; using System.Diagnostics; internal class SmiGettersStream : Stream { private SmiEventSink_Default _sink; private ITypedGettersV3 _getters; private int _ordinal; private long _readPosition; private SmiMetaData _metaData; internal SmiGettersStream( SmiEventSink_Default sink, ITypedGettersV3 getters, int ordinal, SmiMetaData metaData ) { Debug.Assert( null != sink ); Debug.Assert( null != getters ); Debug.Assert( 0 <= ordinal ); Debug.Assert( null != metaData ); _sink = sink; _getters = getters; _ordinal = ordinal; _readPosition = 0; _metaData = metaData; } public override bool CanRead { get { return true; } } // If CanSeek is false, Position, Seek, Length, and SetLength should throw. public override bool CanSeek { get { return false; } } public override bool CanWrite { get { return false; } } public override long Length { get { return ValueUtilsSmi.GetBytesInternal( _sink, _getters, _ordinal, _metaData, 0, null, 0, 0, false ); } } public override long Position { get { return _readPosition; } set { throw SQL.StreamSeekNotSupported(); } } public override void Flush() { throw SQL.StreamWriteNotSupported(); } public override long Seek(long offset, SeekOrigin origin) { throw SQL.StreamSeekNotSupported(); } public override void SetLength(long value) { throw SQL.StreamWriteNotSupported(); } public override int Read( byte[] buffer, int offset, int count ) { long bytesRead = ValueUtilsSmi.GetBytesInternal( _sink, _getters, _ordinal, _metaData, _readPosition, buffer, offset, count, false ); _readPosition += bytesRead; return checked( (int) bytesRead ); } public override void Write( byte[] buffer, int offset, int count ) { throw SQL.StreamWriteNotSupported(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AggregateException.cs
- Handle.cs
- TimeSpan.cs
- TextSelection.cs
- SspiNegotiationTokenAuthenticator.cs
- InputScopeManager.cs
- SettingsBase.cs
- ReadonlyMessageFilter.cs
- OdbcCommand.cs
- UserControlParser.cs
- ErrorEventArgs.cs
- _UncName.cs
- X509CertificateChain.cs
- ExceptionDetail.cs
- SystemPens.cs
- CodeObjectCreateExpression.cs
- FontFamilyIdentifier.cs
- WindowsProgressbar.cs
- EmissiveMaterial.cs
- HttpCapabilitiesBase.cs
- Rfc4050KeyFormatter.cs
- ListViewUpdatedEventArgs.cs
- ProxyGenerationError.cs
- XmlUrlResolver.cs
- DataSourceSelectArguments.cs
- FormViewPageEventArgs.cs
- HttpResponse.cs
- ImportException.cs
- EventTrigger.cs
- QilPatternVisitor.cs
- DataColumnCollection.cs
- TextWriterTraceListener.cs
- BamlWriter.cs
- CacheSection.cs
- RequestCachePolicyConverter.cs
- AssemblyFilter.cs
- KeyedHashAlgorithm.cs
- ExpressionBuilder.cs
- XamlSerializerUtil.cs
- SoapEnumAttribute.cs
- NativeMethods.cs
- IsolatedStorageSecurityState.cs
- AuthorizationSection.cs
- CodeNamespaceCollection.cs
- CustomValidator.cs
- FontTypeConverter.cs
- OlePropertyStructs.cs
- SQLString.cs
- ImageSource.cs
- NamespaceQuery.cs
- SqlAliasesReferenced.cs
- DataObjectCopyingEventArgs.cs
- WebPartUserCapability.cs
- TailCallAnalyzer.cs
- ViewGenResults.cs
- ArcSegment.cs
- DataProtection.cs
- listitem.cs
- ProcessHostConfigUtils.cs
- AmbientValueAttribute.cs
- SkewTransform.cs
- _CookieModule.cs
- SetStoryboardSpeedRatio.cs
- RenderData.cs
- SafeBitVector32.cs
- SqlUnionizer.cs
- ZoneButton.cs
- ListViewDeleteEventArgs.cs
- ResourceManager.cs
- PathFigureCollectionConverter.cs
- HeaderedItemsControl.cs
- FaultContractInfo.cs
- VirtualDirectoryMapping.cs
- SourceFilter.cs
- ProvidersHelper.cs
- IsolatedStorage.cs
- Drawing.cs
- XmlArrayAttribute.cs
- LoggedException.cs
- Column.cs
- HtmlTableRow.cs
- EventMappingSettingsCollection.cs
- KeyConverter.cs
- Transform3DGroup.cs
- ClientCultureInfo.cs
- GroupLabel.cs
- EventProviderTraceListener.cs
- SignedPkcs7.cs
- GraphicsPath.cs
- ScriptBehaviorDescriptor.cs
- RetrieveVirtualItemEventArgs.cs
- XmlDocumentType.cs
- DbDataAdapter.cs
- XmlAtomicValue.cs
- DataObject.cs
- PathSegment.cs
- CommonGetThemePartSize.cs
- ClickablePoint.cs
- ListDictionary.cs
- WindowsListViewGroupSubsetLink.cs