Code:
/ FX-1434 / FX-1434 / 1.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
- WindowAutomationPeer.cs
- XmlLinkedNode.cs
- XmlAttributeCollection.cs
- Exceptions.cs
- TypeRefElement.cs
- HttpServerUtilityWrapper.cs
- DataRecordInternal.cs
- ModuleConfigurationInfo.cs
- ToolboxBitmapAttribute.cs
- EntitySetDataBindingList.cs
- WinFormsUtils.cs
- UIElementHelper.cs
- IpcManager.cs
- GlyphsSerializer.cs
- SessionEndedEventArgs.cs
- SourceSwitch.cs
- TargetFrameworkUtil.cs
- XPathPatternParser.cs
- SuppressMessageAttribute.cs
- COAUTHINFO.cs
- processwaithandle.cs
- ToolBarTray.cs
- PtsHost.cs
- SignatureTargetIdManager.cs
- ClientBuildManagerCallback.cs
- WindowsUpDown.cs
- StringCollection.cs
- BrowserTree.cs
- QueryOutputWriter.cs
- Label.cs
- XmlUtilWriter.cs
- AutomationEvent.cs
- DesignerUtility.cs
- ComponentDispatcher.cs
- NullExtension.cs
- CommonGetThemePartSize.cs
- ExceptionRoutedEventArgs.cs
- BitmapMetadataBlob.cs
- BitmapEncoder.cs
- XPathNodeList.cs
- NativeRecognizer.cs
- DiffuseMaterial.cs
- XPathDocumentIterator.cs
- GenericsInstances.cs
- IssuedSecurityTokenParameters.cs
- EntityDataSourceSelectingEventArgs.cs
- WorkflowClientDeliverMessageWrapper.cs
- XPathConvert.cs
- BuildDependencySet.cs
- DefaultPrintController.cs
- EntityDataSourceMemberPath.cs
- ResourceReader.cs
- StreamAsIStream.cs
- DesignerAdapterUtil.cs
- ActivationServices.cs
- DrawingDrawingContext.cs
- Executor.cs
- IsolationInterop.cs
- SchemaElementDecl.cs
- Misc.cs
- PersonalizableTypeEntry.cs
- AssociationSet.cs
- ResourceKey.cs
- ContractMethodParameterInfo.cs
- DockPattern.cs
- EncoderExceptionFallback.cs
- EndEvent.cs
- FloaterBaseParagraph.cs
- NativeMethods.cs
- StreamUpgradeProvider.cs
- ConnectionInterfaceCollection.cs
- XmlHierarchyData.cs
- CustomExpression.cs
- SqlVisitor.cs
- AppDomainFactory.cs
- BulletChrome.cs
- Stack.cs
- PerspectiveCamera.cs
- SimpleBitVector32.cs
- CodeTryCatchFinallyStatement.cs
- XPathDocumentNavigator.cs
- CellCreator.cs
- COM2ICategorizePropertiesHandler.cs
- SectionVisual.cs
- CTreeGenerator.cs
- ProxyHelper.cs
- ExpressionWriter.cs
- CategoriesDocumentFormatter.cs
- FixedDSBuilder.cs
- Rectangle.cs
- DataGridViewRowConverter.cs
- SerialReceived.cs
- MarginsConverter.cs
- ComProxy.cs
- FacetValueContainer.cs
- SqlMethodTransformer.cs
- WeakRefEnumerator.cs
- UnSafeCharBuffer.cs
- ElementAction.cs
- ImageMetadata.cs