Advertisement
sewer56lol

T4 Template Output

Mar 17th, 2020
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.80 KB | None | 0 0
  1.  
  2.  
  3. using System.IO;
  4. using System.Runtime.CompilerServices;
  5.  
  6. namespace Reloaded.Memory.Utilities
  7. {
  8.     public partial class ExtendedMemoryStream
  9.     {
  10.         /// <summary>
  11.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  12.         /// </summary>
  13.         public void WriteBigEndianPrimitive(byte structure)
  14.         {
  15.             structure = Endian.Reverse(structure);
  16.             Write(Struct.GetBytes(structure));
  17.         }
  18.         /// <summary>
  19.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  20.         /// </summary>
  21.         public void WriteBigEndianPrimitive(sbyte structure)
  22.         {
  23.             structure = Endian.Reverse(structure);
  24.             Write(Struct.GetBytes(structure));
  25.         }
  26.         /// <summary>
  27.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  28.         /// </summary>
  29.         public void WriteBigEndianPrimitive(short structure)
  30.         {
  31.             structure = Endian.Reverse(structure);
  32.             Write(Struct.GetBytes(structure));
  33.         }
  34.         /// <summary>
  35.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  36.         /// </summary>
  37.         public void WriteBigEndianPrimitive(ushort structure)
  38.         {
  39.             structure = Endian.Reverse(structure);
  40.             Write(Struct.GetBytes(structure));
  41.         }
  42.         /// <summary>
  43.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  44.         /// </summary>
  45.         public void WriteBigEndianPrimitive(int structure)
  46.         {
  47.             structure = Endian.Reverse(structure);
  48.             Write(Struct.GetBytes(structure));
  49.         }
  50.         /// <summary>
  51.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  52.         /// </summary>
  53.         public void WriteBigEndianPrimitive(uint structure)
  54.         {
  55.             structure = Endian.Reverse(structure);
  56.             Write(Struct.GetBytes(structure));
  57.         }
  58.         /// <summary>
  59.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  60.         /// </summary>
  61.         public void WriteBigEndianPrimitive(long structure)
  62.         {
  63.             structure = Endian.Reverse(structure);
  64.             Write(Struct.GetBytes(structure));
  65.         }
  66.         /// <summary>
  67.         /// Appends an unmanaged structure onto the <see cref="MemoryStream"/> and advances the position.
  68.         /// </summary>
  69.         public void WriteBigEndianPrimitive(ulong structure)
  70.         {
  71.             structure = Endian.Reverse(structure);
  72.             Write(Struct.GetBytes(structure));
  73.         }
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement