Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / Microsoft / SqlServer / Server / SmiSettersStream.cs / 1305376 / SmiSettersStream.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace Microsoft.SqlServer.Server { using System; using System.Data.Common; using System.Data.SqlClient; using System.Diagnostics; using System.IO; internal class SmiSettersStream : Stream { private SmiEventSink_Default _sink; private ITypedSettersV3 _setters; private int _ordinal; private long _lengthWritten; private SmiMetaData _metaData; internal SmiSettersStream( SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SmiMetaData metaData ) { Debug.Assert( null != sink ); Debug.Assert( null != setters ); Debug.Assert( 0 <= ordinal ); Debug.Assert( null != metaData ); _sink = sink; _setters = setters; _ordinal = ordinal; _lengthWritten = 0; _metaData = metaData; } public override bool CanRead { get { return false; } } // If CanSeek is false, Position, Seek, Length, and SetLength should throw. public override bool CanSeek { get { return false; } } public override bool CanWrite { get { return true; } } public override long Length { get { return _lengthWritten; } } public override long Position { get { return _lengthWritten; } set { throw SQL.StreamSeekNotSupported(); } } public override void Flush() { _lengthWritten = ValueUtilsSmi.SetBytesLength(_sink, _setters, _ordinal, _metaData, _lengthWritten); } public override long Seek(long offset, SeekOrigin origin) { throw SQL.StreamSeekNotSupported(); } public override void SetLength(long value) { if ( value < 0 ) { throw ADP.ArgumentOutOfRange("value"); } ValueUtilsSmi.SetBytesLength(_sink, _setters, _ordinal, _metaData, value); } public override int Read(byte[] buffer, int offset, int count) { throw SQL.StreamReadNotSupported(); } public override void Write(byte[] buffer, int offset, int count) { _lengthWritten += ValueUtilsSmi.SetBytes(_sink, _setters, _ordinal, _metaData, _lengthWritten, buffer, offset, count); } } } // 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
- PreservationFileReader.cs
- ExclusiveTcpListener.cs
- ValidationSummary.cs
- DataGridCommandEventArgs.cs
- ItemMap.cs
- SystemIPv4InterfaceProperties.cs
- LiteralControl.cs
- BigInt.cs
- ForceCopyBuildProvider.cs
- ControlEvent.cs
- BitmapMetadataEnumerator.cs
- MembershipPasswordException.cs
- SecureConversationServiceElement.cs
- SolidBrush.cs
- TypeSystemProvider.cs
- FormViewRow.cs
- StringStorage.cs
- ImmutableObjectAttribute.cs
- ActivityBuilderHelper.cs
- _SpnDictionary.cs
- ObjectDataSourceFilteringEventArgs.cs
- InlineCollection.cs
- entityreference_tresulttype.cs
- GenericTypeParameterBuilder.cs
- FixedDSBuilder.cs
- DefaultProxySection.cs
- SchemaContext.cs
- StateManagedCollection.cs
- EntryPointNotFoundException.cs
- TraceUtils.cs
- ProcessHost.cs
- CodeGroup.cs
- MemberPath.cs
- MappedMetaModel.cs
- HScrollProperties.cs
- SecurityProtocol.cs
- BinaryFormatter.cs
- AddInDeploymentState.cs
- ConstNode.cs
- RegistrationServices.cs
- DefaultTraceListener.cs
- FormViewDesigner.cs
- ItemCollection.cs
- IntranetCredentialPolicy.cs
- RepeatBehaviorConverter.cs
- SqlAliaser.cs
- MetabaseSettingsIis7.cs
- GeometryConverter.cs
- DrawingBrush.cs
- QueryInterceptorAttribute.cs
- WindowsProgressbar.cs
- CompilerParameters.cs
- PolyBezierSegment.cs
- WebEncodingValidatorAttribute.cs
- CipherData.cs
- Image.cs
- OptimalTextSource.cs
- AggregationMinMaxHelpers.cs
- FormViewRow.cs
- ThreadPool.cs
- ImageAutomationPeer.cs
- TeredoHelper.cs
- TextStore.cs
- EventMappingSettingsCollection.cs
- IPEndPoint.cs
- ExtendedProperty.cs
- FileIOPermission.cs
- ResourceReferenceKeyNotFoundException.cs
- SoundPlayer.cs
- ProtectedConfiguration.cs
- ReaderWriterLock.cs
- DataGridItemCollection.cs
- TreeView.cs
- PropertyEmitterBase.cs
- OperandQuery.cs
- oledbconnectionstring.cs
- DataObjectPastingEventArgs.cs
- AttributeCollection.cs
- SqlCrossApplyToCrossJoin.cs
- StoreContentChangedEventArgs.cs
- EventBuilder.cs
- UrlRoutingModule.cs
- XmlCDATASection.cs
- FileAuthorizationModule.cs
- SelectingProviderEventArgs.cs
- RecommendedAsConfigurableAttribute.cs
- XmlAnyAttributeAttribute.cs
- CqlWriter.cs
- Version.cs
- PointLight.cs
- ColorConvertedBitmap.cs
- BrowserCapabilitiesCompiler.cs
- ReplacementText.cs
- DictationGrammar.cs
- WSDualHttpSecurityElement.cs
- IntranetCredentialPolicy.cs
- DnsPermission.cs
- TempFiles.cs
- StateItem.cs
- StringCollection.cs