Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ GetUtf8NullTerminatedLength()

unsafe int System.Reflection.Internal.MemoryBlock.GetUtf8NullTerminatedLength ( int offset,
out int numberOfBytesRead,
char terminator = '\0' )
inlinepackage

Definition at line 250 of file MemoryBlock.cs.

251 {
253 byte* ptr = Pointer + offset;
254 byte* ptr2 = Pointer + Length;
255 byte* ptr3;
256 for (ptr3 = ptr; ptr3 < ptr2; ptr3++)
257 {
258 byte b = *ptr3;
259 if (b == 0 || b == terminator)
260 {
261 break;
262 }
263 }
264 int result = (numberOfBytesRead = (int)(ptr3 - ptr));
265 if (ptr3 < ptr2)
266 {
267 numberOfBytesRead++;
268 }
269 return result;
270 }
void CheckBounds(int offset, int byteCount)

References System.Reflection.Internal.MemoryBlock.CheckBounds(), System.Reflection.Internal.MemoryBlock.Length, and System.offset.

Referenced by System.Reflection.Metadata.Ecma335.StringHeap.GetNonVirtualStringMemoryBlock(), and System.Reflection.Internal.MemoryBlock.PeekUtf8NullTerminated().