Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / Microsoft / SqlServer / Server / SmiGettersStream.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- IOException.cs
- WorkflowInstanceExtensionProvider.cs
- TableRowCollection.cs
- ToolBarTray.cs
- ContextMenuStrip.cs
- SmiRequestExecutor.cs
- CellTreeNode.cs
- ImageIndexConverter.cs
- GZipStream.cs
- DataServiceResponse.cs
- GenerateHelper.cs
- Type.cs
- SessionEndedEventArgs.cs
- ConfigurationStrings.cs
- XmlWhitespace.cs
- DataGridPagerStyle.cs
- ReadOnlyCollectionBuilder.cs
- SqlMethods.cs
- sqlstateclientmanager.cs
- XPathSelfQuery.cs
- InsufficientExecutionStackException.cs
- RequestCacheManager.cs
- ServiceContractListItem.cs
- TextFindEngine.cs
- DocobjHost.cs
- SqlGenerator.cs
- FormViewDeleteEventArgs.cs
- SingleTagSectionHandler.cs
- HandlerFactoryWrapper.cs
- ValueChangedEventManager.cs
- SpeechSeg.cs
- ReceiveDesigner.xaml.cs
- StrokeNodeOperations.cs
- ImageListStreamer.cs
- DesignerActionHeaderItem.cs
- GenericUI.cs
- SafeNativeMethods.cs
- OrthographicCamera.cs
- AuditLog.cs
- TreeViewItemAutomationPeer.cs
- CacheSection.cs
- dbenumerator.cs
- FixedMaxHeap.cs
- EventlogProvider.cs
- HeaderCollection.cs
- NamespaceQuery.cs
- UpdateProgress.cs
- ContextProperty.cs
- DocumentGridPage.cs
- WebPartEditorApplyVerb.cs
- CaseStatement.cs
- CollectionViewGroupRoot.cs
- DefaultAsyncDataDispatcher.cs
- NumberFunctions.cs
- EncodingDataItem.cs
- SafeTimerHandle.cs
- SecurityUniqueId.cs
- DataGridColumnStyleMappingNameEditor.cs
- BindToObject.cs
- XPathExpr.cs
- PropertyChangedEventManager.cs
- PropertyInfoSet.cs
- DataGridRowDetailsEventArgs.cs
- SystemException.cs
- ExternalFile.cs
- ScrollBar.cs
- DefaultBinder.cs
- SqlVersion.cs
- ThemeConfigurationDialog.cs
- AccessViolationException.cs
- PenLineCapValidation.cs
- ShaperBuffers.cs
- MetadataItemSerializer.cs
- SystemTcpStatistics.cs
- ProcessProtocolHandler.cs
- Expression.cs
- SignatureConfirmations.cs
- ParallelSeparator.xaml.cs
- DataGridItemEventArgs.cs
- ConsoleKeyInfo.cs
- ClosureBinding.cs
- DateTime.cs
- GridItem.cs
- UserMapPath.cs
- TextEditor.cs
- XmlExtensionFunction.cs
- PeerNameRegistration.cs
- Geometry.cs
- XmlIterators.cs
- CssStyleCollection.cs
- MobileFormsAuthentication.cs
- ProfileSection.cs
- DiscardableAttribute.cs
- GroupQuery.cs
- FamilyMapCollection.cs
- MouseWheelEventArgs.cs
- SqlNotificationEventArgs.cs
- FontUnit.cs
- SoapSchemaMember.cs
- InstanceNameConverter.cs