512 {
514 {
515 bytesWritten = 0;
517 }
519 {
521 if (
buffer.Length >= maxEncodedToUtf8Length)
522 {
523 int num = dataLength - dataLength / 3 * 3;
524 uint num2 = (uint)(maxEncodedToUtf8Length - 4);
525 uint num3 = (uint)(dataLength - num);
526 uint num4 = 0u;
528 if (num != 0)
529 {
532 num2 -= 4;
533 }
534 num3 -= 3;
535 while ((int)num3 >= 0)
536 {
537 num4 =
Encode(ptr + num3, ref reference);
539 num2 -= 4;
540 num3 -= 3;
541 }
542 bytesWritten = maxEncodedToUtf8Length;
544 }
545 bytesWritten = 0;
547 }
548 }
static unsafe uint Encode(byte *threeBytes, ref byte encodingMap)
static unsafe uint EncodeAndPadOne(byte *twoBytes, ref byte encodingMap)
static int GetMaxEncodedToUtf8Length(int length)
static ReadOnlySpan< byte > EncodingMap
static unsafe uint EncodeAndPadTwo(byte *oneByte, ref byte encodingMap)