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
- RoutedUICommand.cs
- RichTextBox.cs
- ProgressiveCrcCalculatingStream.cs
- Section.cs
- BaseCodePageEncoding.cs
- Filter.cs
- TableLayoutSettingsTypeConverter.cs
- WebBrowserNavigatingEventHandler.cs
- Win32KeyboardDevice.cs
- TypeDescriptor.cs
- GridItemCollection.cs
- ViewCellRelation.cs
- _ProxyRegBlob.cs
- FilterException.cs
- AccessKeyManager.cs
- PtsHelper.cs
- ChangePassword.cs
- WebHostScriptMappingsInstallComponent.cs
- ContextDataSourceContextData.cs
- TrackBarRenderer.cs
- QilTernary.cs
- ConfigurationLoaderException.cs
- OneOf.cs
- JavaScriptObjectDeserializer.cs
- CompositionTarget.cs
- DbBuffer.cs
- CommandEventArgs.cs
- TraceContext.cs
- Material.cs
- TraceListeners.cs
- GlobalEventManager.cs
- DriveInfo.cs
- XmlSchemaValidationException.cs
- ContainerControlDesigner.cs
- EndpointConfigContainer.cs
- ToolStripContentPanel.cs
- SmiEventSink_DeferedProcessing.cs
- DriveInfo.cs
- XmlDomTextWriter.cs
- SessionStateItemCollection.cs
- CaseInsensitiveHashCodeProvider.cs
- BuiltInExpr.cs
- SizeChangedEventArgs.cs
- Registry.cs
- LassoHelper.cs
- RightsManagementInformation.cs
- Marshal.cs
- SecurityContextTokenValidationException.cs
- SID.cs
- DecoratedNameAttribute.cs
- Encoder.cs
- HwndHost.cs
- GlyphRun.cs
- ConfigurationPropertyAttribute.cs
- AsyncOperation.cs
- DetailsViewDeleteEventArgs.cs
- SystemIPGlobalStatistics.cs
- util.cs
- WpfWebRequestHelper.cs
- IconBitmapDecoder.cs
- AsyncPostBackErrorEventArgs.cs
- TextSerializer.cs
- SessionSwitchEventArgs.cs
- UnSafeCharBuffer.cs
- WebPartCatalogCloseVerb.cs
- parserscommon.cs
- CheckBoxList.cs
- EnumerableCollectionView.cs
- XamlRtfConverter.cs
- Button.cs
- Rotation3DAnimation.cs
- ReadOnlyAttribute.cs
- TextEndOfLine.cs
- CompositeFontFamily.cs
- EventBuilder.cs
- ApplicationHost.cs
- safemediahandle.cs
- CodeObjectCreateExpression.cs
- SecurityElementBase.cs
- Rectangle.cs
- PersonalizationStateQuery.cs
- UriExt.cs
- ReflectionServiceProvider.cs
- SystemException.cs
- MarkupExtensionParser.cs
- ExpandCollapsePattern.cs
- MemberDomainMap.cs
- FileDialogCustomPlace.cs
- HtmlInputText.cs
- ZipPackagePart.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- AsyncOperation.cs
- XomlCompiler.cs
- WindowsFormsHost.cs
- SystemGatewayIPAddressInformation.cs
- MessageEnumerator.cs
- EntityDataSourceContainerNameConverter.cs
- MonthCalendarDesigner.cs
- XPathDocumentNavigator.cs
- Int32Converter.cs