Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#@ template debug="false" hostspecific="false" language="C#" #>
- <#@ assembly name="System.Core" #>
- <#@ output extension=".cs" #>
- <#
- string[] types = { "byte", "sbyte", "short", "ushort", "int", "uint", "long", "ulong" };
- #>
- using System.IO;
- using System.Runtime.CompilerServices;
- namespace Reloaded.Memory.Utilities
- {
- public partial class ExtendedMemoryStream
- {
- <#
- foreach (var type in types)
- {
- #> /// <summary>
- /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
- /// </summary>
- public void WriteBigEndianPrimitive(<#= type #> structure)
- {
- structure = Endian.Reverse(structure);
- Write(Struct.GetBytes(structure));
- }
- <#
- }
- #>
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement