1- using System ;
1+ #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2+ using System ;
23using System . Collections . Generic ;
34using System . Reflection ;
45using System . Runtime . InteropServices ;
@@ -113,6 +114,10 @@ private void PushArray<T>(T[] t, bool knownSize = false)
113114 foreach ( T t1 in t ) Push ( signed ? ( object ) ZigZagEncode ( t1 as long ? ?? t1 as int ? ?? t1 as short ? ?? t1 as sbyte ? ?? 0 , size ) : ( object ) t1 ) ;
114115 }
115116
117+ /// <summary>
118+ /// Serializes data, allocates an array and returns it
119+ /// </summary>
120+ /// <returns>Allocated array with written data</returns>
116121 public byte [ ] Finalize ( )
117122 {
118123 long bitCount = 0 ;
@@ -133,6 +138,11 @@ public byte[] Finalize()
133138 }
134139
135140 //The ref is not needed. It's purley there to indicate that it's treated as a reference inside the method.
141+ /// <summary>
142+ /// Writes data to the given buffer
143+ /// </summary>
144+ /// <param name="buffer"></param>
145+ /// <returns>The amount of bytes written</returns>
136146 public long Finalize ( ref byte [ ] buffer )
137147 {
138148 if ( buffer == null )
@@ -161,6 +171,10 @@ public long Finalize(ref byte[] buffer)
161171 return ( bitCount / 8 ) + ( bitCount % 8 == 0 ? 0 : 1 ) ;
162172 }
163173
174+ /// <summary>
175+ /// Gets the size in bytes if you were to serialize now
176+ /// </summary>
177+ /// <returns>The size in bytes</returns>
164178 public long GetFinalizeSize ( )
165179 {
166180 long bitCount = 0 ;
@@ -391,3 +405,4 @@ public void Dispose()
391405 }
392406 }
393407}
408+ #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
0 commit comments