Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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. // //[....] //[....] //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- StaticContext.cs
- JumpList.cs
- StreamWriter.cs
- StandardToolWindows.cs
- SessionPageStateSection.cs
- MatrixAnimationBase.cs
- PopOutPanel.cs
- ModifierKeysValueSerializer.cs
- QueryOperationResponseOfT.cs
- DbgUtil.cs
- ShaderEffect.cs
- XhtmlConformanceSection.cs
- RenderContext.cs
- ObjectAnimationBase.cs
- DataShape.cs
- QilVisitor.cs
- OAVariantLib.cs
- HotCommands.cs
- SafeMILHandle.cs
- IntegerValidator.cs
- Argument.cs
- SqlUtils.cs
- WindowsRebar.cs
- ColorConvertedBitmapExtension.cs
- DocComment.cs
- ClientTargetCollection.cs
- XhtmlBasicTextViewAdapter.cs
- StrongTypingException.cs
- RemotingAttributes.cs
- TrustManagerMoreInformation.cs
- DocComment.cs
- ListViewSelectEventArgs.cs
- ComAdminInterfaces.cs
- Matrix3D.cs
- DynamicRenderer.cs
- PropertyItemInternal.cs
- HideDisabledControlAdapter.cs
- Metafile.cs
- ArglessEventHandlerProxy.cs
- ActiveXSite.cs
- SqlLiftIndependentRowExpressions.cs
- PropertyDescriptor.cs
- SqlTransaction.cs
- UrlPath.cs
- documentsequencetextpointer.cs
- ResourceExpression.cs
- selecteditemcollection.cs
- ElementsClipboardData.cs
- FontUnit.cs
- AspCompat.cs
- Nullable.cs
- BamlCollectionHolder.cs
- DesignerDataColumn.cs
- EditorZone.cs
- XPathDocumentNavigator.cs
- EventPrivateKey.cs
- Util.cs
- BitmapMetadataBlob.cs
- TagMapInfo.cs
- ProcessInputEventArgs.cs
- MultipartContentParser.cs
- ExceptionHandlerDesigner.cs
- DesignerVerb.cs
- NativeMethodsCLR.cs
- Point4D.cs
- RuntimeConfigLKG.cs
- ResourceType.cs
- DefaultPrintController.cs
- AddInDeploymentState.cs
- SQLSingle.cs
- mediapermission.cs
- List.cs
- LeafCellTreeNode.cs
- _UriSyntax.cs
- IERequestCache.cs
- XmlLoader.cs
- DataObjectPastingEventArgs.cs
- cache.cs
- ColorConvertedBitmap.cs
- DesignerDeviceConfig.cs
- BackgroundWorker.cs
- Run.cs
- EncryptedKey.cs
- ManualWorkflowSchedulerService.cs
- RouteItem.cs
- SchemaElementLookUpTable.cs
- TreeNodeConverter.cs
- AttributedMetaModel.cs
- SimpleFileLog.cs
- XmlSyndicationContent.cs
- DataGridRowHeaderAutomationPeer.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- BindingBase.cs
- MembershipValidatePasswordEventArgs.cs
- SecurityDescriptor.cs
- InvalidOperationException.cs
- ColumnClickEvent.cs
- CredentialCache.cs
- PageCache.cs
- HostedHttpContext.cs