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
- ConnectionStringsExpressionEditor.cs
- RegexFCD.cs
- SignatureHelper.cs
- ImmutableCollection.cs
- GridViewRow.cs
- TreeNodeClickEventArgs.cs
- Expression.cs
- Mapping.cs
- SiteMapNodeItemEventArgs.cs
- ComplexPropertyEntry.cs
- ReflectPropertyDescriptor.cs
- FormViewInsertEventArgs.cs
- IOThreadScheduler.cs
- VBIdentifierTrimConverter.cs
- BamlCollectionHolder.cs
- GeneralTransform2DTo3DTo2D.cs
- SerializeAbsoluteContext.cs
- MenuRendererStandards.cs
- VBIdentifierName.cs
- ApplicationActivator.cs
- SmtpNegotiateAuthenticationModule.cs
- VariantWrapper.cs
- DbFunctionCommandTree.cs
- ConfigXmlAttribute.cs
- PreviewControlDesigner.cs
- RegisteredHiddenField.cs
- ObjectListField.cs
- SqlMethodTransformer.cs
- ProcessInfo.cs
- DesignRelationCollection.cs
- TitleStyle.cs
- BoolLiteral.cs
- MessageSmuggler.cs
- ProviderManager.cs
- Empty.cs
- SecurityException.cs
- ToolStripPanelRenderEventArgs.cs
- ImageKeyConverter.cs
- ArithmeticException.cs
- CalculatedColumn.cs
- Stylesheet.cs
- WsdlImporterElementCollection.cs
- datacache.cs
- DataGridRow.cs
- CfgSemanticTag.cs
- XmlEntityReference.cs
- Int32CollectionConverter.cs
- X509ChainPolicy.cs
- ProcessManager.cs
- SharedPerformanceCounter.cs
- WindowsIdentity.cs
- MessageBox.cs
- XsdCachingReader.cs
- ArrayList.cs
- UIPermission.cs
- PolicyAssertionCollection.cs
- NotifyCollectionChangedEventArgs.cs
- WhitespaceRule.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- XamlWriter.cs
- TcpConnectionPoolSettingsElement.cs
- CodeParameterDeclarationExpressionCollection.cs
- DataRecordInternal.cs
- Debug.cs
- OLEDB_Util.cs
- XamlSerializer.cs
- Parsers.cs
- SecondaryViewProvider.cs
- StylusPointPropertyInfoDefaults.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- UIPropertyMetadata.cs
- ByteRangeDownloader.cs
- CollectionViewGroup.cs
- Config.cs
- AddInContractAttribute.cs
- ReturnType.cs
- BitConverter.cs
- DesigntimeLicenseContext.cs
- GlobalizationAssembly.cs
- Compilation.cs
- SharedPerformanceCounter.cs
- AspNetSynchronizationContext.cs
- SystemSounds.cs
- DataGridViewButtonColumn.cs
- Schema.cs
- TypeConverterHelper.cs
- TypeDescriptorFilterService.cs
- DataGridViewButtonColumn.cs
- PatternMatcher.cs
- AssemblyAssociatedContentFileAttribute.cs
- OletxCommittableTransaction.cs
- ObjectDataSourceMethodEventArgs.cs
- TableHeaderCell.cs
- PenLineJoinValidation.cs
- CompositeFontInfo.cs
- PrintDialog.cs
- WeakReference.cs
- HtmlInputControl.cs
- FontStretches.cs
- FormViewUpdateEventArgs.cs