Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// 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
// 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
- ConvertBinder.cs
- TreeView.cs
- GiveFeedbackEvent.cs
- XmlMembersMapping.cs
- WebAdminConfigurationHelper.cs
- ReachNamespaceInfo.cs
- HostProtectionPermission.cs
- ForeignKeyConstraint.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- cookiecontainer.cs
- XmlDocumentFragment.cs
- DataViewListener.cs
- ControlPaint.cs
- ServiceDescriptionData.cs
- MeasureItemEvent.cs
- PropertyInfoSet.cs
- XmlSchemaSubstitutionGroup.cs
- ConnectionManagementElementCollection.cs
- XPathDescendantIterator.cs
- SerializationAttributes.cs
- WebPartConnectionsCancelVerb.cs
- HuffmanTree.cs
- RegexParser.cs
- LoginView.cs
- ReliableDuplexSessionChannel.cs
- CustomErrorsSectionWrapper.cs
- MoveSizeWinEventHandler.cs
- DataKey.cs
- HttpCookie.cs
- BitmapEffectInput.cs
- Transform.cs
- CheckBoxList.cs
- MouseWheelEventArgs.cs
- BitmapEffectInputData.cs
- FileCodeGroup.cs
- WebBrowserNavigatingEventHandler.cs
- DependencyPropertyAttribute.cs
- UnsafeNetInfoNativeMethods.cs
- GPPOINTF.cs
- DataViewListener.cs
- MdImport.cs
- _SSPISessionCache.cs
- Int32Rect.cs
- WindowsSysHeader.cs
- SettingsAttributes.cs
- NavigationProperty.cs
- ObjectDisposedException.cs
- TransactionsSectionGroup.cs
- ObjectListDataBindEventArgs.cs
- UpdatePanelTrigger.cs
- errorpatternmatcher.cs
- DocumentPaginator.cs
- DataGridColumnCollection.cs
- ToolStripOverflowButton.cs
- WebBrowserNavigatedEventHandler.cs
- NotifyCollectionChangedEventArgs.cs
- NodeCounter.cs
- RestHandler.cs
- _UriTypeConverter.cs
- RTLAwareMessageBox.cs
- QueryStoreStatusRequest.cs
- MouseOverProperty.cs
- XmlSiteMapProvider.cs
- CipherData.cs
- SizeValueSerializer.cs
- HtmlControlPersistable.cs
- Comparer.cs
- NavigationFailedEventArgs.cs
- SQLDecimal.cs
- TableStyle.cs
- BinaryFormatterWriter.cs
- XmlCharCheckingReader.cs
- CapiSymmetricAlgorithm.cs
- SynchronizationFilter.cs
- CalendarButton.cs
- Table.cs
- ControlParameter.cs
- IdentifierElement.cs
- SizeAnimation.cs
- CompilerCollection.cs
- HtmlMeta.cs
- ItemsPresenter.cs
- NativeMethods.cs
- ObjectItemConventionAssemblyLoader.cs
- StructuredType.cs
- RegexWriter.cs
- BevelBitmapEffect.cs
- CachingHintValidation.cs
- ErrorHandler.cs
- MatrixTransform3D.cs
- ApplicationTrust.cs
- Run.cs
- TrustLevelCollection.cs
- PLINQETWProvider.cs
- RuntimeVariablesExpression.cs
- IdentityNotMappedException.cs
- XmlDataSourceView.cs
- CodeRemoveEventStatement.cs
- Authorization.cs
- ExtendedProperty.cs