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
- Int32Rect.cs
- Relationship.cs
- QueryCreatedEventArgs.cs
- NativeMethods.cs
- ComboBoxRenderer.cs
- DefaultDialogButtons.cs
- InstanceNameConverter.cs
- ClientConfigurationHost.cs
- PrivilegedConfigurationManager.cs
- TraceRecord.cs
- DataGridViewLinkCell.cs
- EntityPropertyMappingAttribute.cs
- HideDisabledControlAdapter.cs
- WebPartChrome.cs
- Int16Storage.cs
- XmlSerializerAssemblyAttribute.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SqlUserDefinedTypeAttribute.cs
- ProcessModuleCollection.cs
- HandleCollector.cs
- ScriptBehaviorDescriptor.cs
- ProtectedConfiguration.cs
- SQLRoleProvider.cs
- XmlDigitalSignatureProcessor.cs
- Ray3DHitTestResult.cs
- XmlCountingReader.cs
- ComponentResourceManager.cs
- wgx_commands.cs
- Constraint.cs
- LifetimeServices.cs
- TypeConverterHelper.cs
- DurableInstance.cs
- ResourceDictionaryCollection.cs
- DataRelationPropertyDescriptor.cs
- NavigatorInput.cs
- SimplePropertyEntry.cs
- StrokeNodeOperations.cs
- DrawingContextWalker.cs
- COM2FontConverter.cs
- SoundPlayer.cs
- MessageContractAttribute.cs
- Rotation3DAnimationBase.cs
- RegexGroupCollection.cs
- ChannelFactoryRefCache.cs
- ByteStream.cs
- Converter.cs
- connectionpool.cs
- DateTimeFormatInfoScanner.cs
- SystemIcons.cs
- Subset.cs
- Misc.cs
- Attributes.cs
- EnumerableCollectionView.cs
- TextDecoration.cs
- TimeEnumHelper.cs
- Config.cs
- PropertyIDSet.cs
- ToolStripLabel.cs
- SamlAttribute.cs
- SessionPageStatePersister.cs
- AppSettings.cs
- URIFormatException.cs
- TableCellCollection.cs
- OracleConnection.cs
- MethodImplAttribute.cs
- MetadataCacheItem.cs
- Color.cs
- URL.cs
- XamlBrushSerializer.cs
- QilLoop.cs
- __TransparentProxy.cs
- WebPartUtil.cs
- ObjectListCommandsPage.cs
- TimelineGroup.cs
- DecimalSumAggregationOperator.cs
- ProfilePropertySettingsCollection.cs
- PackageStore.cs
- WeakReference.cs
- Encoding.cs
- TextFormatterContext.cs
- ZipIOModeEnforcingStream.cs
- PeerSecurityManager.cs
- CursorConverter.cs
- AppearanceEditorPart.cs
- StringPropertyBuilder.cs
- RegexCaptureCollection.cs
- SqlPersonalizationProvider.cs
- ParameterToken.cs
- WhitespaceRuleLookup.cs
- WebPartDescriptionCollection.cs
- SQLByte.cs
- StylusCaptureWithinProperty.cs
- SoapEnumAttribute.cs
- SslStream.cs
- OracleString.cs
- DiffuseMaterial.cs
- BitmapMetadata.cs
- TempEnvironment.cs
- HttpResponseHeader.cs
- HashAlgorithm.cs