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
- SchemaTableColumn.cs
- Configuration.cs
- NodeLabelEditEvent.cs
- HwndHostAutomationPeer.cs
- arc.cs
- _AcceptOverlappedAsyncResult.cs
- WsdlInspector.cs
- PerformanceCounterManager.cs
- MonthCalendar.cs
- ProfileInfo.cs
- SuppressedPackageProperties.cs
- TreeNode.cs
- SessionPageStateSection.cs
- Sql8ConformanceChecker.cs
- UpdatePanelControlTrigger.cs
- Graphics.cs
- ListBoxItemWrapperAutomationPeer.cs
- BitmapEffect.cs
- SequenceRange.cs
- webclient.cs
- UnionExpr.cs
- XMLSyntaxException.cs
- LogicalExpr.cs
- AuthenticationModulesSection.cs
- AbsoluteQuery.cs
- InvalidWMPVersionException.cs
- PerformanceCounterPermissionAttribute.cs
- QilInvokeLateBound.cs
- Clause.cs
- NavigationPropertySingletonExpression.cs
- GacUtil.cs
- EntityTransaction.cs
- ToolboxItemAttribute.cs
- Site.cs
- SqlBulkCopyColumnMapping.cs
- _LocalDataStore.cs
- Function.cs
- FigureParagraph.cs
- ThreadAbortException.cs
- TrustVersion.cs
- OutOfProcStateClientManager.cs
- RepeatEnumerable.cs
- WriteableBitmap.cs
- LiteralControl.cs
- FastEncoder.cs
- ShutDownListener.cs
- WebBrowser.cs
- ArgumentDesigner.xaml.cs
- HighlightVisual.cs
- DependencyObjectProvider.cs
- RemoteWebConfigurationHostStream.cs
- WebEventCodes.cs
- AlternateView.cs
- EditCommandColumn.cs
- RolePrincipal.cs
- PersianCalendar.cs
- DateRangeEvent.cs
- MDIClient.cs
- ProvidersHelper.cs
- _NetRes.cs
- DockPattern.cs
- TreeNodeStyleCollection.cs
- PropertyRecord.cs
- WebPartDisplayModeCollection.cs
- UpdateCompiler.cs
- Compensate.cs
- MsmqException.cs
- cryptoapiTransform.cs
- FilePresentation.cs
- TagMapInfo.cs
- DecodeHelper.cs
- UriTemplate.cs
- FontInfo.cs
- CustomErrorCollection.cs
- CellLabel.cs
- Empty.cs
- ContentIterators.cs
- MobileComponentEditorPage.cs
- NavigationEventArgs.cs
- PhysicalFontFamily.cs
- DesignerDataTable.cs
- WinEventWrap.cs
- ExpressionBuilderContext.cs
- Utilities.cs
- VideoDrawing.cs
- ImageMap.cs
- PartBasedPackageProperties.cs
- DataRowCollection.cs
- WindowsUpDown.cs
- CqlParserHelpers.cs
- ConstrainedDataObject.cs
- RegexCharClass.cs
- TableRowCollection.cs
- BitmapEffectrendercontext.cs
- TimeoutException.cs
- EdmValidator.cs
- TreeNodeBinding.cs
- SplitterPanelDesigner.cs
- ProviderConnectionPoint.cs
- RuntimeHandles.cs