Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Net / System / Net / _BufferOffsetSize.cs / 1 / _BufferOffsetSize.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Net { // // this class is used by the BeginMultipleSend() API // to allow a user to send multiple buffers on a socket // internal class BufferOffsetSize { // // internal members // internal byte[] Buffer; internal int Offset; internal int Size; internal BufferOffsetSize(byte[] buffer, int offset, int size, bool copyBuffer) { GlobalLog.Assert(buffer != null && buffer.Length >= size + offset, "BufferOffsetSize::.ctor|Illegal parameters."); if (copyBuffer) { byte[] newBuffer = new byte[size]; System.Buffer.BlockCopy( buffer, // src offset, // src index newBuffer, // dest 0, // dest index size ); // total size to copy offset = 0; buffer = newBuffer; } Buffer = buffer; Offset = offset; Size = size; GlobalLog.Print("BufferOffsetSize#" + ValidationHelper.HashString(this) + "::.ctor() copyBuffer:" + copyBuffer.ToString() + " this:[" + ToString() + "]"); } /* // Consider removing. internal BufferOffsetSize(byte[] buffer, int offset, bool copyBuffer) : this(buffer, offset, buffer.Length - offset, copyBuffer) { } */ /* // Consider removing. internal BufferOffsetSize(int size, byte[] buffer, bool copyBuffer) : this(buffer, 0, size, copyBuffer) { } */ internal BufferOffsetSize(byte[] buffer, bool copyBuffer) : this(buffer, 0, buffer.Length, copyBuffer) { } #if TRAVE public override string ToString() { return "BufferOffsetSize#" + ValidationHelper.HashString(this) + " Buffer#" + ValidationHelper.HashString(Buffer) + " Offset:" + Offset.ToString() + " Size:" + Size.ToString(); } #endif } // class BufferOffsetSize } // namespace System.Net
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ImageClickEventArgs.cs
- TableCellCollection.cs
- DataGridViewCellParsingEventArgs.cs
- MenuItemCollection.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- MulticastOption.cs
- CustomError.cs
- ContextStack.cs
- ConnectionProviderAttribute.cs
- StyleBamlRecordReader.cs
- CollectionsUtil.cs
- AutomationProperties.cs
- GraphicsPath.cs
- _SslState.cs
- GridEntry.cs
- DLinqColumnProvider.cs
- SqlInfoMessageEvent.cs
- GridToolTip.cs
- WpfWebRequestHelper.cs
- DataContractSerializerMessageContractImporter.cs
- DecimalMinMaxAggregationOperator.cs
- XamlFigureLengthSerializer.cs
- FixedSOMLineRanges.cs
- StringValueSerializer.cs
- FontResourceCache.cs
- AddressAccessDeniedException.cs
- XmlSerializerFactory.cs
- UnsafeNativeMethods.cs
- WebZoneDesigner.cs
- EasingFunctionBase.cs
- DataChangedEventManager.cs
- DataGridViewIntLinkedList.cs
- FileChangesMonitor.cs
- FixedSchema.cs
- HTMLTagNameToTypeMapper.cs
- IdentityHolder.cs
- Baml2006KeyRecord.cs
- DataTableExtensions.cs
- HuffModule.cs
- unsafenativemethodstextservices.cs
- EmptyEnumerator.cs
- Assembly.cs
- ContainerSelectorGlyph.cs
- BitmapSourceSafeMILHandle.cs
- KeyPressEvent.cs
- StringResourceManager.cs
- baseaxisquery.cs
- EditorPart.cs
- DataPagerFieldItem.cs
- SelectionProcessor.cs
- Internal.cs
- XmlAttributeCollection.cs
- MD5.cs
- TimeSpanParse.cs
- ConstantExpression.cs
- WeakRefEnumerator.cs
- NamespaceList.cs
- TextWriterTraceListener.cs
- ServiceProviders.cs
- ListViewGroupCollectionEditor.cs
- TypeName.cs
- ErrorWrapper.cs
- IImplicitResourceProvider.cs
- FontStretchConverter.cs
- NTAccount.cs
- TypeSystem.cs
- FillErrorEventArgs.cs
- TrackingServices.cs
- ConfigurationValidatorAttribute.cs
- KeyInfo.cs
- SHA256.cs
- NGCSerializationManager.cs
- ProgressChangedEventArgs.cs
- AmbientProperties.cs
- HandoffBehavior.cs
- ServiceOperationViewControl.cs
- EventLogException.cs
- XmlSchemaAny.cs
- RtfToXamlReader.cs
- SAPICategories.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- AssemblyCache.cs
- ProfileSection.cs
- FieldAccessException.cs
- WebPartConnectionsCancelVerb.cs
- BreakSafeBase.cs
- RSACryptoServiceProvider.cs
- Random.cs
- UriScheme.cs
- ClientTargetCollection.cs
- wgx_exports.cs
- PeerApplication.cs
- StreamReader.cs
- BrowserCapabilitiesCompiler.cs
- TextWriter.cs
- RegexInterpreter.cs
- CollectionChangeEventArgs.cs
- FontConverter.cs
- webclient.cs
- SemanticValue.cs