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
- QilList.cs
- UnsafeNativeMethods.cs
- FormatConvertedBitmap.cs
- AuthStoreRoleProvider.cs
- ValidationPropertyAttribute.cs
- TemplateBindingExpressionConverter.cs
- ExpressionEditorAttribute.cs
- RichTextBoxConstants.cs
- XmlSchemaSequence.cs
- SecurityKeyIdentifierClause.cs
- RemotingConfiguration.cs
- MessageDescription.cs
- GeneralTransformGroup.cs
- XslTransform.cs
- Icon.cs
- ChannelServices.cs
- KeyValuePairs.cs
- ClientRuntimeConfig.cs
- BaseProcessProtocolHandler.cs
- NamedPipeTransportManager.cs
- HtmlToClrEventProxy.cs
- ResourceDictionary.cs
- _NTAuthentication.cs
- XamlReaderHelper.cs
- cryptoapiTransform.cs
- XmlSchemaSimpleTypeUnion.cs
- MediaPlayerState.cs
- DataGridState.cs
- WindowExtensionMethods.cs
- TrackingStringDictionary.cs
- LoginUtil.cs
- QuerySettings.cs
- GeneralTransform3DCollection.cs
- MsmqIntegrationReceiveParameters.cs
- SafeNativeMethods.cs
- DefaultMemberAttribute.cs
- NamespaceList.cs
- HttpCacheVaryByContentEncodings.cs
- InputLangChangeEvent.cs
- InkSerializer.cs
- ImmComposition.cs
- ServiceContractListItemList.cs
- SplitContainer.cs
- HttpProcessUtility.cs
- EntityDataSourceReferenceGroup.cs
- MenuEventArgs.cs
- BamlLocalizableResource.cs
- updatecommandorderer.cs
- PageParserFilter.cs
- InfoCardConstants.cs
- SelectionWordBreaker.cs
- __ComObject.cs
- VisemeEventArgs.cs
- PerformanceCounterPermissionEntryCollection.cs
- XmlWhitespace.cs
- SQLGuidStorage.cs
- ToolStripDesignerAvailabilityAttribute.cs
- VisualStyleTypesAndProperties.cs
- ResourceDictionary.cs
- XmlNavigatorFilter.cs
- WebHttpSecurityModeHelper.cs
- HtmlShim.cs
- RankException.cs
- StylusLogic.cs
- EdmToObjectNamespaceMap.cs
- ColumnClickEvent.cs
- TextEffect.cs
- Attributes.cs
- CompilerLocalReference.cs
- EdgeModeValidation.cs
- DocComment.cs
- MarginsConverter.cs
- XmlValidatingReaderImpl.cs
- ImageInfo.cs
- EntityDataSourceMemberPath.cs
- ListViewInsertedEventArgs.cs
- WebPartTracker.cs
- Drawing.cs
- TraceLevelHelper.cs
- TraceUtility.cs
- AnimatedTypeHelpers.cs
- WebMessageFormatHelper.cs
- activationcontext.cs
- AppAction.cs
- SafeNativeMethods.cs
- BinaryUtilClasses.cs
- MetadataArtifactLoaderCompositeFile.cs
- DataGridItemCollection.cs
- AttachmentService.cs
- FileDocument.cs
- DropDownHolder.cs
- Facet.cs
- Formatter.cs
- CriticalExceptions.cs
- HttpStaticObjectsCollectionWrapper.cs
- AddInControllerImpl.cs
- SqlBooleanizer.cs
- FunctionImportMapping.cs
- RecognitionEventArgs.cs
- OptionalMessageQuery.cs