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
- ListItemCollection.cs
- XmlQueryContext.cs
- unsafenativemethodsother.cs
- WebPartEventArgs.cs
- SettingsPropertyValue.cs
- GetWorkflowTree.cs
- HitTestDrawingContextWalker.cs
- DropDownHolder.cs
- StoreAnnotationsMap.cs
- ConstructorArgumentAttribute.cs
- XmlToDatasetMap.cs
- TableRow.cs
- HwndKeyboardInputProvider.cs
- Table.cs
- SchemaTableColumn.cs
- DragEventArgs.cs
- ProcessManager.cs
- TextTreeDeleteContentUndoUnit.cs
- OleDbTransaction.cs
- XamlWriter.cs
- HyperLinkColumn.cs
- ToolStripScrollButton.cs
- ConfigurationValidatorBase.cs
- SecureStringHasher.cs
- IsolatedStorageFileStream.cs
- Int64.cs
- DomNameTable.cs
- IdnElement.cs
- EmptyCollection.cs
- ServiceMetadataBehavior.cs
- TypedReference.cs
- Storyboard.cs
- ProcessInputEventArgs.cs
- ControlBindingsCollection.cs
- Pair.cs
- Rect.cs
- ColumnMap.cs
- SQLStringStorage.cs
- OutputCacheProfileCollection.cs
- Button.cs
- InvalidOleVariantTypeException.cs
- WindowsSlider.cs
- WorkItem.cs
- SafeCertificateContext.cs
- OleStrCAMarshaler.cs
- FileDialogCustomPlace.cs
- UIElementPropertyUndoUnit.cs
- TouchPoint.cs
- Soap.cs
- ModelServiceImpl.cs
- FunctionParameter.cs
- XmlAnyElementAttribute.cs
- DataViewManager.cs
- SimpleTypeResolver.cs
- FusionWrap.cs
- WpfSharedBamlSchemaContext.cs
- Attributes.cs
- LocalFileSettingsProvider.cs
- DataGridViewSortCompareEventArgs.cs
- RangeValuePattern.cs
- PropertyDescriptor.cs
- ParseNumbers.cs
- OleDragDropHandler.cs
- Profiler.cs
- FacetValues.cs
- Inflater.cs
- GraphicsPath.cs
- Documentation.cs
- ValidationErrorEventArgs.cs
- Console.cs
- Pair.cs
- ProviderCollection.cs
- StorageEntityTypeMapping.cs
- MediaPlayerState.cs
- XsltConvert.cs
- ProcessInfo.cs
- ListViewCancelEventArgs.cs
- SerializationFieldInfo.cs
- FontStyleConverter.cs
- HtmlTernaryTree.cs
- FrameworkElementAutomationPeer.cs
- odbcmetadatacollectionnames.cs
- MouseOverProperty.cs
- _NegoStream.cs
- DataServiceHostFactory.cs
- SchemaAttDef.cs
- DesignerWebPartChrome.cs
- Timer.cs
- ReadOnlyNameValueCollection.cs
- OutputScopeManager.cs
- SafeRightsManagementSessionHandle.cs
- rsa.cs
- MultiAsyncResult.cs
- CultureInfo.cs
- ObjectItemAssemblyLoader.cs
- FormViewDeletedEventArgs.cs
- WebResourceUtil.cs
- StateMachineWorkflow.cs
- TypeListConverter.cs
- TextEditorDragDrop.cs