1
- using System ;
1
+ #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2
+ using System ;
2
3
using System . Collections . Generic ;
3
4
using System . Reflection ;
4
5
using System . Runtime . InteropServices ;
@@ -113,6 +114,10 @@ private void PushArray<T>(T[] t, bool knownSize = false)
113
114
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 ) ;
114
115
}
115
116
117
+ /// <summary>
118
+ /// Serializes data, allocates an array and returns it
119
+ /// </summary>
120
+ /// <returns>Allocated array with written data</returns>
116
121
public byte [ ] Finalize ( )
117
122
{
118
123
long bitCount = 0 ;
@@ -133,6 +138,11 @@ public byte[] Finalize()
133
138
}
134
139
135
140
//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>
136
146
public long Finalize ( ref byte [ ] buffer )
137
147
{
138
148
if ( buffer == null )
@@ -161,6 +171,10 @@ public long Finalize(ref byte[] buffer)
161
171
return ( bitCount / 8 ) + ( bitCount % 8 == 0 ? 0 : 1 ) ;
162
172
}
163
173
174
+ /// <summary>
175
+ /// Gets the size in bytes if you were to serialize now
176
+ /// </summary>
177
+ /// <returns>The size in bytes</returns>
164
178
public long GetFinalizeSize ( )
165
179
{
166
180
long bitCount = 0 ;
@@ -391,3 +405,4 @@ public void Dispose()
391
405
}
392
406
}
393
407
}
408
+ #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member
0 commit comments