Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Markup / BamlBinaryWriter.cs / 1 / BamlBinaryWriter.cs
/****************************************************************************\ * * File: BamlBinaryWriter.cs * * Purpose: Subclass BinaryWriter. * * Copyright (C) 2006 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.IO; using System.Text; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { internal class BamlBinaryWriter: BinaryWriter { public BamlBinaryWriter(Stream stream, Encoding code) :base(stream, code) { } public new void Write7BitEncodedInt(int value) { base.Write7BitEncodedInt(value); } public static int SizeOf7bitEncodedSize(int size) { const int _7bits = 0x7F; const int _14bits = ( _7bits << 7) | _7bits; const int _21bits = (_14bits << 7) | _7bits; const int _28bits = (_21bits << 7) | _7bits; if (0 == (size & ~_7bits)) return 1; if (0 == (size & ~_14bits)) return 2; if (0 == (size & ~_21bits)) return 3; if (0 == (size & ~_28bits)) return 4; return 5; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /****************************************************************************\ * * File: BamlBinaryWriter.cs * * Purpose: Subclass BinaryWriter. * * Copyright (C) 2006 by Microsoft Corporation. All rights reserved. * \***************************************************************************/ using System; using System.IO; using System.Text; #if PBTCOMPILER namespace MS.Internal.Markup #else namespace System.Windows.Markup #endif { internal class BamlBinaryWriter: BinaryWriter { public BamlBinaryWriter(Stream stream, Encoding code) :base(stream, code) { } public new void Write7BitEncodedInt(int value) { base.Write7BitEncodedInt(value); } public static int SizeOf7bitEncodedSize(int size) { const int _7bits = 0x7F; const int _14bits = ( _7bits << 7) | _7bits; const int _21bits = (_14bits << 7) | _7bits; const int _28bits = (_21bits << 7) | _7bits; if (0 == (size & ~_7bits)) return 1; if (0 == (size & ~_14bits)) return 2; if (0 == (size & ~_21bits)) return 3; if (0 == (size & ~_28bits)) return 4; return 5; } } } // 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
- DbSetClause.cs
- SimpleExpression.cs
- TreePrinter.cs
- ADMembershipProvider.cs
- ExtractedStateEntry.cs
- BindingOperations.cs
- Scheduler.cs
- DoubleLinkListEnumerator.cs
- ContourSegment.cs
- MLangCodePageEncoding.cs
- ViewRendering.cs
- Compilation.cs
- Request.cs
- ShapeTypeface.cs
- RadioButtonStandardAdapter.cs
- WhitespaceRule.cs
- RegexTree.cs
- DateTimeFormatInfo.cs
- RawTextInputReport.cs
- ClientBuildManager.cs
- TreeBuilder.cs
- nulltextnavigator.cs
- TextAction.cs
- FastEncoder.cs
- LingerOption.cs
- ArraySortHelper.cs
- IISMapPath.cs
- RawStylusInput.cs
- WsatServiceAddress.cs
- ScriptingWebServicesSectionGroup.cs
- ComponentResourceKeyConverter.cs
- Size.cs
- DesignTimeDataBinding.cs
- DeploymentSection.cs
- MethodToken.cs
- UnmanagedMemoryStreamWrapper.cs
- Int16AnimationUsingKeyFrames.cs
- NativeMethods.cs
- UrlAuthorizationModule.cs
- Match.cs
- HiddenFieldPageStatePersister.cs
- DataKey.cs
- DocumentPageHost.cs
- RegexWriter.cs
- AddInSegmentDirectoryNotFoundException.cs
- SqlDataSource.cs
- FlowLayoutSettings.cs
- HtmlTableRow.cs
- FormsIdentity.cs
- CodeStatementCollection.cs
- EditingMode.cs
- DbProviderFactory.cs
- PrintDialogException.cs
- Vector3DCollection.cs
- BlockCollection.cs
- QueryableDataSource.cs
- DataBoundLiteralControl.cs
- Transform.cs
- HttpModuleCollection.cs
- PlainXmlDeserializer.cs
- RightsManagementUser.cs
- TraceInternal.cs
- PropertyInformationCollection.cs
- InheritanceAttribute.cs
- ADMembershipProvider.cs
- ListViewCancelEventArgs.cs
- Int64Converter.cs
- NonSerializedAttribute.cs
- XmlNode.cs
- SqlDataSourceQueryEditorForm.cs
- CompilationLock.cs
- DataGridViewTopRowAccessibleObject.cs
- TabItemAutomationPeer.cs
- EventHandlers.cs
- DocumentPageViewAutomationPeer.cs
- RowToFieldTransformer.cs
- InvalidPipelineStoreException.cs
- Parameter.cs
- GetPageCompletedEventArgs.cs
- BindingContext.cs
- NullableIntMinMaxAggregationOperator.cs
- GridViewSortEventArgs.cs
- XappLauncher.cs
- _AutoWebProxyScriptEngine.cs
- StateWorkerRequest.cs
- SqlDataSource.cs
- BinHexEncoder.cs
- SchemaReference.cs
- Vector.cs
- PropertyToken.cs
- DataGridPagingPage.cs
- BlockingCollection.cs
- ConstraintConverter.cs
- SortKey.cs
- DataGridViewButtonColumn.cs
- TreeNodeSelectionProcessor.cs
- BaseParser.cs
- WorkflowMessageEventHandler.cs
- _SslSessionsCache.cs
- RotateTransform.cs