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
- FontUnitConverter.cs
- EncoderParameters.cs
- XamlNamespaceHelper.cs
- ReliableMessagingVersionConverter.cs
- FlatButtonAppearance.cs
- Psha1DerivedKeyGeneratorHelper.cs
- ImageCodecInfoPrivate.cs
- XmlDataSourceView.cs
- AttachmentCollection.cs
- ContentElementAutomationPeer.cs
- DirtyTextRange.cs
- FileDialog.cs
- PenCursorManager.cs
- _UncName.cs
- SqlReorderer.cs
- Subtree.cs
- SqlCaseSimplifier.cs
- ObjectToken.cs
- TreeNodeStyleCollection.cs
- WebAdminConfigurationHelper.cs
- DataError.cs
- FixedTextBuilder.cs
- ScriptingProfileServiceSection.cs
- DynamicQueryableWrapper.cs
- HandoffBehavior.cs
- SecurityChannelListener.cs
- OuterGlowBitmapEffect.cs
- SoapFaultCodes.cs
- StringResourceManager.cs
- TemplateManager.cs
- ReflectionHelper.cs
- AsymmetricSecurityProtocol.cs
- ToolStripLabel.cs
- XmlSchemaSimpleContentRestriction.cs
- WindowsBrush.cs
- EntityContainer.cs
- NullableConverter.cs
- SQLDecimalStorage.cs
- GridViewSelectEventArgs.cs
- RawStylusInputReport.cs
- PropertyIDSet.cs
- PropertyChangeTracker.cs
- TextEditorCharacters.cs
- EntityKey.cs
- SingleConverter.cs
- MembershipValidatePasswordEventArgs.cs
- ExportFileRequest.cs
- ProviderConnectionPoint.cs
- ExtenderHelpers.cs
- ScrollEvent.cs
- Char.cs
- DelimitedListTraceListener.cs
- HealthMonitoringSection.cs
- CrossSiteScriptingValidation.cs
- PropertyCondition.cs
- DesignTableCollection.cs
- ItemContainerPattern.cs
- IdentityHolder.cs
- RayHitTestParameters.cs
- SqlDataSourceCustomCommandEditor.cs
- ListBoxAutomationPeer.cs
- CompositeFontFamily.cs
- Debug.cs
- SrgsElement.cs
- ImageMapEventArgs.cs
- ClientRoleProvider.cs
- TextPenaltyModule.cs
- SqlDataReader.cs
- X509Certificate2.cs
- SQLDateTimeStorage.cs
- DbProviderFactories.cs
- EntityModelBuildProvider.cs
- BinHexDecoder.cs
- ColumnWidthChangingEvent.cs
- SafeFileMappingHandle.cs
- ListItemConverter.cs
- AncillaryOps.cs
- SmtpCommands.cs
- MarshalDirectiveException.cs
- COAUTHIDENTITY.cs
- XmlObjectSerializerReadContextComplex.cs
- MediaContextNotificationWindow.cs
- SystemColorTracker.cs
- FeatureManager.cs
- AutoScrollExpandMessageFilter.cs
- RtfControls.cs
- PrinterSettings.cs
- AnonymousIdentificationModule.cs
- LiteralControl.cs
- WizardPanel.cs
- ReachSerializationUtils.cs
- FlowDocumentPage.cs
- RegularExpressionValidator.cs
- Win32Exception.cs
- BrushConverter.cs
- WebReferenceOptions.cs
- QueryStringConverter.cs
- AttributeCollection.cs
- basecomparevalidator.cs
- Mapping.cs