@@ -175,15 +175,17 @@ public static bool TryReadBigEndian(global::System.ReadOnlySpan<byte> source, [g
175175/// <remarks> <list type="table">
176176/// <item> <term><b>Field</b></term> <description><b>Byte Length</b></description> </item>
177177/// <item> <term><see cref="Value"/></term> <description>1</description> </item>
178- /// <item> <term><see cref="Array"/></term> <description><see cref="OneArray.GetByteCount()"/> </description> </item>
179- /// <item> <term> --- </term> <description>1 + <see cref="OneArray.GetByteCount()"/> </description> </item>
178+ /// <item> <term><see cref="Array"/></term> <description>2 </description> </item>
179+ /// <item> <term> --- </term> <description>3 </description> </item>
180180/// </list> </remarks>
181+ [ global ::Darp . BinaryObjects . BinaryConstant ( 3 ) ]
181182public sealed partial record OneBinaryObject : global ::Darp . BinaryObjects . IBinaryObject < OneBinaryObject >
182183{
183184 /// <inheritdoc />
185+ [ global ::System . Diagnostics . Contracts . Pure ]
184186 [ global ::System . Runtime . CompilerServices . MethodImpl ( global ::System . Runtime . CompilerServices . MethodImplOptions . AggressiveInlining ) ]
185187 [ global ::System . CodeDom . Compiler . GeneratedCodeAttribute ( "Darp.BinaryObjects.Generator" , "GeneratorVersion" ) ]
186- public int GetByteCount ( ) => 1 + this . Array . GetByteCount ( ) ;
188+ public int GetByteCount ( ) => 3 ;
187189
188190 /// <inheritdoc />
189191 [ global ::System . CodeDom . Compiler . GeneratedCodeAttribute ( "Darp.BinaryObjects.Generator" , "GeneratorVersion" ) ]
@@ -194,14 +196,11 @@ public bool TryWriteLittleEndian(global::System.Span<byte> destination, out int
194196 {
195197 bytesWritten = 0 ;
196198
197- if ( destination . Length < 1 )
199+ if ( destination . Length < 3 )
198200 return false ;
199201 global ::Darp . BinaryObjects . Generated . Utilities . WriteBinaryObjectLittleEndian ( destination [ 0 ..] , this . Value ) ;
200- bytesWritten += 1 ;
201-
202- if ( ! this . Array . TryWriteLittleEndian ( destination [ 1 ..] , out var ___bytesWrittenArray ) )
203- return false ;
204- bytesWritten += ___bytesWrittenArray ;
202+ global ::Darp . BinaryObjects . Generated . Utilities . WriteBinaryObjectLittleEndian ( destination [ 1 ..] , this . Array ) ;
203+ bytesWritten += 3 ;
205204
206205 return true ;
207206 }
@@ -214,14 +213,11 @@ public bool TryWriteBigEndian(global::System.Span<byte> destination, out int byt
214213 {
215214 bytesWritten = 0 ;
216215
217- if ( destination . Length < 1 )
216+ if ( destination . Length < 3 )
218217 return false ;
219218 global ::Darp . BinaryObjects . Generated . Utilities . WriteBinaryObjectBigEndian ( destination [ 0 ..] , this . Value ) ;
220- bytesWritten += 1 ;
221-
222- if ( ! this . Array . TryWriteBigEndian ( destination [ 1 ..] , out var ___bytesWrittenArray ) )
223- return false ;
224- bytesWritten += ___bytesWrittenArray ;
219+ global ::Darp . BinaryObjects . Generated . Utilities . WriteBinaryObjectBigEndian ( destination [ 1 ..] , this . Array ) ;
220+ bytesWritten += 3 ;
225221
226222 return true ;
227223 }
@@ -236,14 +232,11 @@ public static bool TryReadLittleEndian(global::System.ReadOnlySpan<byte> source,
236232 bytesRead = 0 ;
237233 value = default ;
238234
239- if ( source . Length < 1 )
235+ if ( source . Length < 3 )
240236 return false ;
241237 var ___readValue = global ::Darp . BinaryObjects . Generated . Utilities . ReadBinaryObjectLittleEndian < OneBool > ( source [ 0 ..1 ] ) ;
242- bytesRead += 1 ;
243-
244- if ( ! OneArray . TryReadLittleEndian ( source [ 1 ..] , out var ___readArray , out var ___bytesReadArray ) )
245- return false ;
246- bytesRead += ___bytesReadArray ;
238+ var ___readArray = global ::Darp . BinaryObjects . Generated . Utilities . ReadBinaryObjectLittleEndian < OneArray > ( source [ 1 ..3 ] ) ;
239+ bytesRead += 3 ;
247240
248241 value = new OneBinaryObject ( ___readValue , ___readArray ) ;
249242 return true ;
@@ -258,14 +251,11 @@ public static bool TryReadBigEndian(global::System.ReadOnlySpan<byte> source, [g
258251 bytesRead = 0 ;
259252 value = default ;
260253
261- if ( source . Length < 1 )
254+ if ( source . Length < 3 )
262255 return false ;
263256 var ___readValue = global ::Darp . BinaryObjects . Generated . Utilities . ReadBinaryObjectBigEndian < OneBool > ( source [ 0 ..1 ] ) ;
264- bytesRead += 1 ;
265-
266- if ( ! OneArray . TryReadBigEndian ( source [ 1 ..] , out var ___readArray , out var ___bytesReadArray ) )
267- return false ;
268- bytesRead += ___bytesReadArray ;
257+ var ___readArray = global ::Darp . BinaryObjects . Generated . Utilities . ReadBinaryObjectBigEndian < OneArray > ( source [ 1 ..3 ] ) ;
258+ bytesRead += 3 ;
269259
270260 value = new OneBinaryObject ( ___readValue , ___readArray ) ;
271261 return true ;
0 commit comments