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
- CodeDOMProvider.cs
- ToggleProviderWrapper.cs
- BamlLocalizer.cs
- VBIdentifierTrimConverter.cs
- DataStorage.cs
- XmlAutoDetectWriter.cs
- SafeEventLogWriteHandle.cs
- Error.cs
- ServiceContractGenerationContext.cs
- Schema.cs
- HierarchicalDataBoundControlAdapter.cs
- DesignerExtenders.cs
- DocumentCollection.cs
- LayoutEngine.cs
- DataGridViewCellStyleConverter.cs
- TypeGeneratedEventArgs.cs
- Helper.cs
- IsolatedStorageFile.cs
- SchemaNames.cs
- ClientTarget.cs
- Exceptions.cs
- XmlHierarchicalEnumerable.cs
- WindowsListViewGroupSubsetLink.cs
- XmlSerializer.cs
- BinaryParser.cs
- XXXInfos.cs
- LocalFileSettingsProvider.cs
- PagedDataSource.cs
- AssemblyCache.cs
- TransferRequestHandler.cs
- XmlReader.cs
- wgx_render.cs
- _ConnectStream.cs
- BitmapSizeOptions.cs
- RootAction.cs
- CollectionConverter.cs
- DataSourceControl.cs
- PropertyEmitter.cs
- DocComment.cs
- TypeInitializationException.cs
- CodeVariableDeclarationStatement.cs
- ExpressionUtilities.cs
- StreamSecurityUpgradeProvider.cs
- OdbcEnvironmentHandle.cs
- OleDbStruct.cs
- RemotingException.cs
- ColumnResizeUndoUnit.cs
- StandardBindingImporter.cs
- CardSpaceException.cs
- DiscreteKeyFrames.cs
- SiteMapNodeCollection.cs
- RowType.cs
- mda.cs
- NativeRecognizer.cs
- XmlEventCache.cs
- ButtonChrome.cs
- _FixedSizeReader.cs
- CryptoConfig.cs
- FrameworkContentElementAutomationPeer.cs
- FormsAuthenticationConfiguration.cs
- TextDocumentView.cs
- HuffmanTree.cs
- RouteItem.cs
- WebResourceAttribute.cs
- IdentityNotMappedException.cs
- DependsOnAttribute.cs
- IdentifierCollection.cs
- TypefaceMap.cs
- TextAnchor.cs
- ActiveXContainer.cs
- ProxyElement.cs
- LinkArea.cs
- LoginDesignerUtil.cs
- ResourceKey.cs
- Matrix3DConverter.cs
- AstNode.cs
- SchemaImporterExtensionElement.cs
- SecurityState.cs
- Pair.cs
- IndexedGlyphRun.cs
- Int32CollectionConverter.cs
- IdentityManager.cs
- DataTableNameHandler.cs
- BordersPage.cs
- BooleanExpr.cs
- ToolStripDropDown.cs
- RawStylusInputCustomData.cs
- HttpCapabilitiesEvaluator.cs
- NamespaceList.cs
- IChannel.cs
- TemplateControlCodeDomTreeGenerator.cs
- AutomationPropertyInfo.cs
- Pen.cs
- SystemTcpStatistics.cs
- exports.cs
- StrongTypingException.cs
- _AutoWebProxyScriptHelper.cs
- ScriptControlManager.cs
- TdsParser.cs
- ParseChildrenAsPropertiesAttribute.cs