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
- NotifyIcon.cs
- OleDbEnumerator.cs
- NamedPipeConnectionPool.cs
- LiteralControl.cs
- SpinWait.cs
- ExtensionWindowHeader.cs
- EntitySet.cs
- HtmlMeta.cs
- XmlHierarchyData.cs
- PartitionedStream.cs
- BaseParser.cs
- GridViewCommandEventArgs.cs
- ClientRuntimeConfig.cs
- DbLambda.cs
- EntitySqlQueryCacheEntry.cs
- _NestedSingleAsyncResult.cs
- EventSourceCreationData.cs
- Effect.cs
- CodeTypeReferenceExpression.cs
- TypeConverter.cs
- VectorValueSerializer.cs
- TypeViewSchema.cs
- MonikerHelper.cs
- ProfileEventArgs.cs
- TypeReference.cs
- __ComObject.cs
- BufferModesCollection.cs
- ContextStaticAttribute.cs
- SecurityRuntime.cs
- DocumentApplication.cs
- OrderedDictionary.cs
- TraceLevelStore.cs
- RecognizedWordUnit.cs
- TextEditorThreadLocalStore.cs
- AutoSizeComboBox.cs
- DeflateStream.cs
- FontNamesConverter.cs
- IndexedString.cs
- PersistChildrenAttribute.cs
- MouseGestureValueSerializer.cs
- SamlEvidence.cs
- AspCompat.cs
- StringToken.cs
- panel.cs
- ColumnReorderedEventArgs.cs
- CompilerScopeManager.cs
- SamlSecurityTokenAuthenticator.cs
- InstanceCreationEditor.cs
- CodeIdentifier.cs
- XmlEnumAttribute.cs
- InlineCollection.cs
- EDesignUtil.cs
- IdleTimeoutMonitor.cs
- TcpAppDomainProtocolHandler.cs
- IisTraceWebEventProvider.cs
- SqlProfileProvider.cs
- HashAlgorithm.cs
- XPathNavigatorException.cs
- DataGridViewColumnConverter.cs
- BinaryObjectReader.cs
- FormatterServicesNoSerializableCheck.cs
- LinkArea.cs
- CommandSet.cs
- HttpCacheVaryByContentEncodings.cs
- KeyedCollection.cs
- brushes.cs
- AdRotator.cs
- ObjectReaderCompiler.cs
- PropertyTab.cs
- HtmlTableRow.cs
- ValueExpressions.cs
- X509CertificateCollection.cs
- SqlConnectionPoolProviderInfo.cs
- ConfigurationException.cs
- CodeEntryPointMethod.cs
- PageEventArgs.cs
- SingletonInstanceContextProvider.cs
- BrowserCapabilitiesFactory.cs
- EqualityComparer.cs
- HandoffBehavior.cs
- CachedBitmap.cs
- ByeMessageApril2005.cs
- LicenseContext.cs
- commandenforcer.cs
- HtmlInputRadioButton.cs
- EncodingNLS.cs
- ExpandCollapseProviderWrapper.cs
- Part.cs
- ConfigXmlElement.cs
- DefaultParameterValueAttribute.cs
- FilteredXmlReader.cs
- ByteStack.cs
- SecurityContextCookieSerializer.cs
- DatagridviewDisplayedBandsData.cs
- EncodingDataItem.cs
- _LocalDataStore.cs
- ComponentChangedEvent.cs
- ColorDialog.cs
- DbXmlEnabledProviderManifest.cs
- ContextBase.cs