Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ControlEvent.cs
- BindingOperations.cs
- DefaultPrintController.cs
- Attachment.cs
- ReadOnlyHierarchicalDataSourceView.cs
- PartitionedDataSource.cs
- OracleConnection.cs
- Visitors.cs
- PerfCounters.cs
- ErrorHandler.cs
- BitmapCacheBrush.cs
- DbConnectionPool.cs
- ResolveMatchesApril2005.cs
- ParameterCollection.cs
- NativeMethods.cs
- ConfigurationStrings.cs
- SerialPinChanges.cs
- ParameterRefs.cs
- CodeAccessPermission.cs
- TdsValueSetter.cs
- SByteConverter.cs
- DocumentViewerBase.cs
- Exceptions.cs
- CultureSpecificStringDictionary.cs
- SingleConverter.cs
- PackagingUtilities.cs
- BufferedGraphicsManager.cs
- AlignmentYValidation.cs
- SHA384CryptoServiceProvider.cs
- FragmentQueryProcessor.cs
- EdmMember.cs
- TextRange.cs
- InvalidDataContractException.cs
- ResolveInfo.cs
- MutableAssemblyCacheEntry.cs
- PropertyEmitter.cs
- ExpressionLink.cs
- SQLResource.cs
- RunInstallerAttribute.cs
- CachedPathData.cs
- PageParser.cs
- WindowsTab.cs
- EventTrigger.cs
- XmlQueryStaticData.cs
- CfgSemanticTag.cs
- SEHException.cs
- CachedPathData.cs
- DeflateStreamAsyncResult.cs
- LogManagementAsyncResult.cs
- ConditionalWeakTable.cs
- MeshGeometry3D.cs
- DbParameterHelper.cs
- HtmlToClrEventProxy.cs
- DataSpaceManager.cs
- GreaterThanOrEqual.cs
- CompositeDispatchFormatter.cs
- HttpBrowserCapabilitiesBase.cs
- SecurityTokenTypes.cs
- XmlSchemaDocumentation.cs
- DataReaderContainer.cs
- IPipelineRuntime.cs
- RoutingEndpointTrait.cs
- DateRangeEvent.cs
- UnsafeNativeMethodsPenimc.cs
- CustomMenuItemCollection.cs
- XPathAncestorIterator.cs
- LinkedList.cs
- DataGridColumnEventArgs.cs
- EventLogPermissionEntryCollection.cs
- BamlRecordHelper.cs
- XsdBuildProvider.cs
- EndpointAddressElementBase.cs
- CaseStatementProjectedSlot.cs
- ConfigurationManagerInternalFactory.cs
- BasicViewGenerator.cs
- ReadOnlyTernaryTree.cs
- MenuItemAutomationPeer.cs
- XmlDeclaration.cs
- SmiMetaDataProperty.cs
- QilFactory.cs
- XmlDataProvider.cs
- DesignerTransactionCloseEvent.cs
- ViewGenerator.cs
- EqualityComparer.cs
- _UncName.cs
- UIAgentMonitorHandle.cs
- DataGridViewControlCollection.cs
- PatternMatcher.cs
- AssociatedControlConverter.cs
- ReflectTypeDescriptionProvider.cs
- DynamicHyperLink.cs
- PropertyChangedEventManager.cs
- RtfControlWordInfo.cs
- HttpApplicationFactory.cs
- XmlSchemaAnnotation.cs
- OpenTypeLayout.cs
- TransformCollection.cs
- SingleStorage.cs
- PackWebRequest.cs
- LinqDataSourceHelper.cs