Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Relationship.cs
- UserInitiatedNavigationPermission.cs
- ResumeStoryboard.cs
- AutomationPropertyInfo.cs
- CustomAttributeFormatException.cs
- ItemCheckedEvent.cs
- Policy.cs
- CodeArgumentReferenceExpression.cs
- CryptographicAttribute.cs
- XmlEnumAttribute.cs
- DataGridViewRow.cs
- RTLAwareMessageBox.cs
- SpecularMaterial.cs
- TagPrefixInfo.cs
- AffineTransform3D.cs
- DateTimeOffsetStorage.cs
- FixedPageProcessor.cs
- Accessible.cs
- safex509handles.cs
- ManagementScope.cs
- TextServicesHost.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- GridViewEditEventArgs.cs
- RegistrySecurity.cs
- RepeatInfo.cs
- PerformanceCounterPermission.cs
- _WinHttpWebProxyDataBuilder.cs
- DataControlPagerLinkButton.cs
- AccessText.cs
- WebPartManagerInternals.cs
- Triangle.cs
- Bits.cs
- UpdateDelegates.Generated.cs
- ProfileProvider.cs
- RegisteredScript.cs
- HttpCacheParams.cs
- NativeObjectSecurity.cs
- FontCacheUtil.cs
- CommandBinding.cs
- RawTextInputReport.cs
- ConnectionsZone.cs
- DataGridViewButtonCell.cs
- HierarchicalDataSourceConverter.cs
- EpmTargetTree.cs
- ConstructorNeedsTagAttribute.cs
- Point4DConverter.cs
- EnumBuilder.cs
- DbLambda.cs
- EventListener.cs
- WSUtilitySpecificationVersion.cs
- RenderData.cs
- DataServiceEntityAttribute.cs
- ButtonStandardAdapter.cs
- EdmProviderManifest.cs
- URLAttribute.cs
- ProtocolElementCollection.cs
- VirtualizingPanel.cs
- ThicknessConverter.cs
- LogSwitch.cs
- NetworkAddressChange.cs
- PasswordValidationException.cs
- CursorConverter.cs
- SmiRequestExecutor.cs
- CompiledIdentityConstraint.cs
- IERequestCache.cs
- DataGridSortCommandEventArgs.cs
- SqlUserDefinedTypeAttribute.cs
- TypeProvider.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DrawListViewItemEventArgs.cs
- AVElementHelper.cs
- TextContainerChangeEventArgs.cs
- DBDataPermission.cs
- ErrorCodes.cs
- XmlSchemaElement.cs
- AttributeCollection.cs
- FixedSOMSemanticBox.cs
- ZipIOBlockManager.cs
- DesignerImageAdapter.cs
- ActivityXamlServices.cs
- DesignerSerializationVisibilityAttribute.cs
- ProfileManager.cs
- CodeRegionDirective.cs
- PersonalizationEntry.cs
- GridLength.cs
- TextAction.cs
- XmlSchemaAttributeGroup.cs
- XmlQueryType.cs
- UITypeEditor.cs
- DragEventArgs.cs
- UnaryNode.cs
- ValidationSummary.cs
- DataSourceXmlSerializationAttribute.cs
- AccessViolationException.cs
- RectConverter.cs
- CategoryAttribute.cs
- ScriptServiceAttribute.cs
- GeneralTransform3DTo2D.cs
- ConditionalAttribute.cs
- FrugalMap.cs