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
- FormViewCommandEventArgs.cs
- BuildResult.cs
- WCFModelStrings.Designer.cs
- BitmapEditor.cs
- SerializerWriterEventHandlers.cs
- XmlNavigatorStack.cs
- WorkflowExecutor.cs
- HexParser.cs
- StylusDevice.cs
- ComponentGlyph.cs
- ModifierKeysConverter.cs
- Thumb.cs
- QueryCreatedEventArgs.cs
- HwndKeyboardInputProvider.cs
- NativeMethods.cs
- DynamicValidatorEventArgs.cs
- Color.cs
- VectorCollectionValueSerializer.cs
- DataGridBoolColumn.cs
- FirstMatchCodeGroup.cs
- DataGridViewCellParsingEventArgs.cs
- ProcessHostServerConfig.cs
- StyleCollection.cs
- MDIControlStrip.cs
- SecurityCookieModeValidator.cs
- NavigationWindow.cs
- PathNode.cs
- FontEmbeddingManager.cs
- Attributes.cs
- NameValueSectionHandler.cs
- AsymmetricAlgorithm.cs
- AssociationEndMember.cs
- ExpressionsCollectionEditor.cs
- DataDocumentXPathNavigator.cs
- Size3D.cs
- XmlTextReaderImpl.cs
- Comparer.cs
- XmlSchemaProviderAttribute.cs
- Guid.cs
- FunctionImportElement.cs
- IdentityModelStringsVersion1.cs
- TdsParserHelperClasses.cs
- TextRangeProviderWrapper.cs
- TransformerTypeCollection.cs
- HashStream.cs
- ResourceKey.cs
- TrackingMemoryStreamFactory.cs
- SetUserLanguageRequest.cs
- SortDescription.cs
- FileVersionInfo.cs
- XmlDictionaryString.cs
- EntityContainer.cs
- DbDataRecord.cs
- DriveNotFoundException.cs
- HMACMD5.cs
- IgnoreFileBuildProvider.cs
- TypeRefElement.cs
- DoubleStorage.cs
- TripleDES.cs
- StorageScalarPropertyMapping.cs
- DataColumnCollection.cs
- CodeTypeParameterCollection.cs
- PropertyTabAttribute.cs
- InkCanvasFeedbackAdorner.cs
- DefaultObjectMappingItemCollection.cs
- InputLangChangeRequestEvent.cs
- KeyValueInternalCollection.cs
- ExpressionBuilderCollection.cs
- StringResourceManager.cs
- COM2ExtendedUITypeEditor.cs
- OleDbPropertySetGuid.cs
- CodeAccessSecurityEngine.cs
- NegotiateStream.cs
- ThreadPool.cs
- TabletDeviceInfo.cs
- Pkcs7Recipient.cs
- ToolStripContainer.cs
- UnsafePeerToPeerMethods.cs
- AsymmetricKeyExchangeDeformatter.cs
- CqlParserHelpers.cs
- SupportingTokenChannel.cs
- DrawingContextDrawingContextWalker.cs
- FragmentNavigationEventArgs.cs
- CookieHandler.cs
- FixedSOMTextRun.cs
- RolePrincipal.cs
- SqlVersion.cs
- InvalidComObjectException.cs
- GuidConverter.cs
- StringArrayConverter.cs
- WorkflowNamespace.cs
- SynchronizationLockException.cs
- DataSetFieldSchema.cs
- BasicViewGenerator.cs
- XsltContext.cs
- MarkupCompilePass2.cs
- TextTreeTextElementNode.cs
- RightsManagementEncryptionTransform.cs
- MatrixKeyFrameCollection.cs
- Random.cs