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
- GlobalizationSection.cs
- ProfileProvider.cs
- TimeSpanOrInfiniteConverter.cs
- EventProviderWriter.cs
- OpCopier.cs
- MultiSelectRootGridEntry.cs
- ValidationErrorCollection.cs
- SecureStringHasher.cs
- SafeLocalAllocation.cs
- EventManager.cs
- TransactionFilter.cs
- TextEmbeddedObject.cs
- DeleteHelper.cs
- WebFaultException.cs
- WhereQueryOperator.cs
- RootBrowserWindowAutomationPeer.cs
- SafeEventLogReadHandle.cs
- DataGridViewRowPrePaintEventArgs.cs
- SQLMoneyStorage.cs
- ComponentCommands.cs
- SQlBooleanStorage.cs
- ToggleButtonAutomationPeer.cs
- InputLanguageCollection.cs
- XPathDocumentNavigator.cs
- RotateTransform.cs
- SlotInfo.cs
- InvalidProgramException.cs
- DataGridViewColumnConverter.cs
- EncryptedType.cs
- GridSplitterAutomationPeer.cs
- ResourceDescriptionAttribute.cs
- ClientSettings.cs
- SoapSchemaImporter.cs
- DataGridTable.cs
- ViewKeyConstraint.cs
- OptimizedTemplateContentHelper.cs
- OdbcInfoMessageEvent.cs
- ToolStripItemCollection.cs
- AsymmetricAlgorithm.cs
- CacheOutputQuery.cs
- _SslState.cs
- TcpActivation.cs
- PolyLineSegment.cs
- FormViewRow.cs
- ValidatorCollection.cs
- DetailsViewPagerRow.cs
- MexTcpBindingCollectionElement.cs
- TreeNodeStyleCollection.cs
- DbMetaDataFactory.cs
- OracleInfoMessageEventArgs.cs
- GenericTypeParameterBuilder.cs
- DataView.cs
- ValidatorCompatibilityHelper.cs
- DataServicePagingProviderWrapper.cs
- PinnedBufferMemoryStream.cs
- MenuItem.cs
- DocumentGridPage.cs
- PermissionSet.cs
- FrameSecurityDescriptor.cs
- HierarchicalDataTemplate.cs
- HttpWebRequestElement.cs
- SuspendDesigner.cs
- SelectionListComponentEditor.cs
- CleanUpVirtualizedItemEventArgs.cs
- TagPrefixAttribute.cs
- RegexParser.cs
- AutomationIdentifier.cs
- DateTimeParse.cs
- GenericUriParser.cs
- KeyEventArgs.cs
- KeyedQueue.cs
- HtmlTableCell.cs
- PreservationFileWriter.cs
- AttributedMetaModel.cs
- NumberFormatInfo.cs
- WorkflowEventArgs.cs
- SecurityElement.cs
- BuildProvider.cs
- VisualBrush.cs
- ResourceDefaultValueAttribute.cs
- InkCanvas.cs
- DataGridViewSelectedRowCollection.cs
- InvalidDataException.cs
- Stylesheet.cs
- OptimizerPatterns.cs
- ProcessHostMapPath.cs
- FieldDescriptor.cs
- SchemaComplexType.cs
- SimpleBitVector32.cs
- KeySpline.cs
- DataGridRowDetailsEventArgs.cs
- KeyConverter.cs
- unsafeIndexingFilterStream.cs
- StringToken.cs
- ItemsChangedEventArgs.cs
- AsymmetricAlgorithm.cs
- RtfControlWordInfo.cs
- listviewsubitemcollectioneditor.cs
- XmlUrlEditor.cs
- InfocardInteractiveChannelInitializer.cs