Code:
/ DotNET / DotNET / 8.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
- TargetControlTypeAttribute.cs
- ExtensionQuery.cs
- PieceDirectory.cs
- ComponentChangingEvent.cs
- ProcessThreadCollection.cs
- Relationship.cs
- Opcode.cs
- WindowsFormsHelpers.cs
- MobileResource.cs
- DataSourceProvider.cs
- EntityFunctions.cs
- Attributes.cs
- GridEntry.cs
- HttpRequestCacheValidator.cs
- UnhandledExceptionEventArgs.cs
- RadialGradientBrush.cs
- NamespaceList.cs
- RegexCode.cs
- ControlBuilderAttribute.cs
- DetailsViewCommandEventArgs.cs
- UpdatePanelTriggerCollection.cs
- MobileComponentEditorPage.cs
- SchemaType.cs
- BindingWorker.cs
- ObfuscationAttribute.cs
- NetworkInterface.cs
- DataGridTablesFactory.cs
- StatusBarAutomationPeer.cs
- XmlLinkedNode.cs
- ThemeableAttribute.cs
- FontResourceCache.cs
- PeerName.cs
- TabItem.cs
- DataRelationCollection.cs
- CodeValidator.cs
- SplitterEvent.cs
- TextEditorTables.cs
- MetafileHeader.cs
- FixedTextContainer.cs
- LockCookie.cs
- DelegatingMessage.cs
- ConnectionManagementSection.cs
- BitStack.cs
- CodeStatementCollection.cs
- OleDbException.cs
- ConnectionsZone.cs
- Accessors.cs
- BinaryNegotiation.cs
- XmlArrayItemAttribute.cs
- SettingsPropertyValueCollection.cs
- UserControlParser.cs
- PassportPrincipal.cs
- TextTrailingWordEllipsis.cs
- CustomValidator.cs
- IdnMapping.cs
- UserControlFileEditor.cs
- LayoutExceptionEventArgs.cs
- ConfigUtil.cs
- Table.cs
- InheritedPropertyChangedEventArgs.cs
- ImageConverter.cs
- FontFamilyValueSerializer.cs
- dbenumerator.cs
- FlowDocumentReaderAutomationPeer.cs
- ConsumerConnectionPointCollection.cs
- ActivityExecutor.cs
- UpdatePanelTrigger.cs
- PrintPreviewDialog.cs
- PageAsyncTask.cs
- DataGridViewColumnConverter.cs
- TextEvent.cs
- SafeNativeMethods.cs
- _ShellExpression.cs
- StateDesigner.cs
- SchemaImporterExtensionElementCollection.cs
- ExpandCollapsePatternIdentifiers.cs
- AliasedSlot.cs
- RootProfilePropertySettingsCollection.cs
- Bezier.cs
- SByte.cs
- mediaeventshelper.cs
- EntityProxyTypeInfo.cs
- TextTabProperties.cs
- DocumentReference.cs
- FontCacheUtil.cs
- WebPartDesigner.cs
- RawStylusSystemGestureInputReport.cs
- RepeatInfo.cs
- FaultDescription.cs
- HealthMonitoringSectionHelper.cs
- MSHTMLHostUtil.cs
- HtmlTableCell.cs
- XPathExpr.cs
- PerfCounters.cs
- EditorPart.cs
- PagerSettings.cs
- BindingExpressionUncommonField.cs
- ProxyHwnd.cs
- MatchingStyle.cs
- unitconverter.cs