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
- SmtpReplyReaderFactory.cs
- XmlSchemaObjectCollection.cs
- ImageBrush.cs
- FixedSOMTableRow.cs
- CorrelationKey.cs
- _SingleItemRequestCache.cs
- ProxyWebPartManagerDesigner.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SharedHttpsTransportManager.cs
- Matrix3DStack.cs
- URL.cs
- SqlParameter.cs
- GeometryDrawing.cs
- ReflectionPermission.cs
- WsatConfiguration.cs
- ListControlBuilder.cs
- ExpressionEditorAttribute.cs
- SqlWebEventProvider.cs
- HttpWebResponse.cs
- RotateTransform.cs
- TableCell.cs
- DateTimeValueSerializerContext.cs
- ControlEvent.cs
- InputScopeConverter.cs
- ElementsClipboardData.cs
- ValidationHelpers.cs
- MailDefinition.cs
- DocumentApplication.cs
- HttpHostedTransportConfiguration.cs
- ListViewEditEventArgs.cs
- ComPersistableTypeElementCollection.cs
- MenuItem.cs
- UnsafeNativeMethods.cs
- Overlapped.cs
- TableRowCollection.cs
- XmlSchemaDatatype.cs
- SqlClientMetaDataCollectionNames.cs
- WindowsTokenRoleProvider.cs
- WebServiceParameterData.cs
- CommonDialog.cs
- ComplexBindingPropertiesAttribute.cs
- PerformanceCounterPermissionEntry.cs
- OrderingQueryOperator.cs
- DeviceSpecificDialogCachedState.cs
- COM2TypeInfoProcessor.cs
- DataGrid.cs
- CodeTypeReference.cs
- EnvelopedPkcs7.cs
- EventSinkActivityDesigner.cs
- WsatServiceCertificate.cs
- Header.cs
- EntityDataSourceDesigner.cs
- EventData.cs
- TcpTransportSecurityElement.cs
- FormViewDeleteEventArgs.cs
- ItemMap.cs
- HandlerBase.cs
- ActiveDocumentEvent.cs
- XmlSchemaSimpleContentExtension.cs
- DispatcherExceptionEventArgs.cs
- ToolBarButton.cs
- InvalidCastException.cs
- SudsWriter.cs
- DataGridViewCellStyleConverter.cs
- SplashScreenNativeMethods.cs
- ImageDrawing.cs
- FreezableCollection.cs
- coordinatorscratchpad.cs
- CodeValidator.cs
- BitmapDownload.cs
- ConfigXmlSignificantWhitespace.cs
- ResourceKey.cs
- ComponentEditorPage.cs
- SqlServer2KCompatibilityAnnotation.cs
- ConfigurationPropertyAttribute.cs
- BlurBitmapEffect.cs
- ProxyHwnd.cs
- SafeNativeMethods.cs
- CaseInsensitiveComparer.cs
- SmiEventSink_DeferedProcessing.cs
- MetadataArtifactLoaderCompositeResource.cs
- SystemEvents.cs
- IntSecurity.cs
- _Win32.cs
- ItemMap.cs
- ExpressionList.cs
- Page.cs
- MouseOverProperty.cs
- InvariantComparer.cs
- DataGridViewCheckBoxCell.cs
- wgx_exports.cs
- UpdateException.cs
- RenderingBiasValidation.cs
- ToolZone.cs
- Int64Converter.cs
- OpenTypeLayout.cs
- CharAnimationBase.cs
- DbMetaDataColumnNames.cs
- PeerApplicationLaunchInfo.cs
- CollectionViewGroupInternal.cs