Lines Matching full:ref
65 … public static void WriteDouble(ref Span<byte> buffer, ref WriterInternalState state, double value) in WriteDouble()
67 … WriteRawLittleEndian64(ref buffer, ref state, (ulong)BitConverter.DoubleToInt64Bits(value)); in WriteDouble()
73 …public static unsafe void WriteFloat(ref Span<byte> buffer, ref WriterInternalState state, float v… in WriteFloat()
80 Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(floatSpan), value); in WriteFloat()
90 WriteFloatSlowPath(ref buffer, ref state, value); in WriteFloat()
95 …private static unsafe void WriteFloatSlowPath(ref Span<byte> buffer, ref WriterInternalState state… in WriteFloatSlowPath()
101 Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(floatSpan), value); in WriteFloatSlowPath()
107 WriteRawByte(ref buffer, ref state, floatSpan[0]); in WriteFloatSlowPath()
108 WriteRawByte(ref buffer, ref state, floatSpan[1]); in WriteFloatSlowPath()
109 WriteRawByte(ref buffer, ref state, floatSpan[2]); in WriteFloatSlowPath()
110 WriteRawByte(ref buffer, ref state, floatSpan[3]); in WriteFloatSlowPath()
116 … public static void WriteUInt64(ref Span<byte> buffer, ref WriterInternalState state, ulong value) in WriteUInt64()
118 WriteRawVarint64(ref buffer, ref state, value); in WriteUInt64()
124 … public static void WriteInt64(ref Span<byte> buffer, ref WriterInternalState state, long value) in WriteInt64()
126 WriteRawVarint64(ref buffer, ref state, (ulong)value); in WriteInt64()
132 … public static void WriteInt32(ref Span<byte> buffer, ref WriterInternalState state, int value) in WriteInt32()
136 WriteRawVarint32(ref buffer, ref state, (uint)value); in WriteInt32()
141 WriteRawVarint64(ref buffer, ref state, (ulong)value); in WriteInt32()
148 … public static void WriteFixed64(ref Span<byte> buffer, ref WriterInternalState state, ulong value) in WriteFixed64()
150 WriteRawLittleEndian64(ref buffer, ref state, value); in WriteFixed64()
156 … public static void WriteFixed32(ref Span<byte> buffer, ref WriterInternalState state, uint value) in WriteFixed32()
158 WriteRawLittleEndian32(ref buffer, ref state, value); in WriteFixed32()
164 … public static void WriteBool(ref Span<byte> buffer, ref WriterInternalState state, bool value) in WriteBool()
166 WriteRawByte(ref buffer, ref state, value ? (byte)1 : (byte)0); in WriteBool()
173 … public static void WriteString(ref Span<byte> buffer, ref WriterInternalState state, string value) in WriteString()
185 … buffer[indexOfLengthDelimiter] = (byte)WriteStringToBuffer(buffer, ref state, value); in WriteString()
190 WriteLength(ref buffer, ref state, length); in WriteString()
198 WriteAsciiStringToBuffer(buffer, ref state, value, length); in WriteString()
202 WriteStringToBuffer(buffer, ref state, value); in WriteString()
212 WriteRawBytes(ref buffer, ref state, bytes); in WriteString()
218 …private static void WriteAsciiStringToBuffer(Span<byte> buffer, ref WriterInternalState state, str… in WriteAsciiStringToBuffer()
220 ref char sourceChars = ref MemoryMarshal.GetReference(value.AsSpan()); in WriteAsciiStringToBuffer()
221 … ref byte destinationBytes = ref MemoryMarshal.GetReference(buffer.Slice(state.position)); in WriteAsciiStringToBuffer()
231 ref byte sourceBytes = ref Unsafe.As<char, byte>(ref sourceChars); in WriteAsciiStringToBuffer()
239 ref Unsafe.AddByteOffset(ref destinationBytes, (IntPtr)currentIndex), in WriteAsciiStringToBuffer()
240 …Unsafe.ReadUnaligned<ulong>(ref Unsafe.AddByteOffset(ref sourceBytes, (IntPtr)(currentIndex * 2)))… in WriteAsciiStringToBuffer()
247 // Avoid bounds checking with ref + Unsafe in WriteAsciiStringToBuffer()
250 …Unsafe.AddByteOffset(ref destinationBytes, (IntPtr)currentIndex) = (byte)Unsafe.AddByteOffset(ref … in WriteAsciiStringToBuffer()
264 …private static void NarrowFourUtf16CharsToAsciiAndWriteToBuffer(ref byte outputBuffer, ulong value) in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
274 Unsafe.WriteUnaligned<uint>(ref outputBuffer, Sse2.ConvertToUInt32(vecNarrow)); in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
283 Unsafe.WriteUnaligned<uint>(ref outputBuffer, lower.AsUInt32().ToScalar()); in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
295 Unsafe.Add(ref outputBuffer, 1) = (byte)value; in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
297 Unsafe.Add(ref outputBuffer, 2) = (byte)value; in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
299 Unsafe.Add(ref outputBuffer, 3) = (byte)value; in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
303 Unsafe.Add(ref outputBuffer, 3) = (byte)value; in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
305 Unsafe.Add(ref outputBuffer, 2) = (byte)value; in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
307 Unsafe.Add(ref outputBuffer, 1) = (byte)value; in NarrowFourUtf16CharsToAsciiAndWriteToBuffer()
314 …private static int WriteStringToBuffer(Span<byte> buffer, ref WriterInternalState state, string va… in WriteStringToBuffer()
319 WriteRawBytes(ref buffer, ref state, bytes); in WriteStringToBuffer()
345 …public static void WriteBytes(ref Span<byte> buffer, ref WriterInternalState state, ByteString val… in WriteBytes()
347 WriteLength(ref buffer, ref state, value.Length); in WriteBytes()
348 WriteRawBytes(ref buffer, ref state, value.Span); in WriteBytes()
354 … public static void WriteUInt32(ref Span<byte> buffer, ref WriterInternalState state, uint value) in WriteUInt32()
356 WriteRawVarint32(ref buffer, ref state, value); in WriteUInt32()
362 … public static void WriteEnum(ref Span<byte> buffer, ref WriterInternalState state, int value) in WriteEnum()
364 WriteInt32(ref buffer, ref state, value); in WriteEnum()
370 … public static void WriteSFixed32(ref Span<byte> buffer, ref WriterInternalState state, int value) in WriteSFixed32()
372 WriteRawLittleEndian32(ref buffer, ref state, (uint)value); in WriteSFixed32()
378 … public static void WriteSFixed64(ref Span<byte> buffer, ref WriterInternalState state, long value) in WriteSFixed64()
380 WriteRawLittleEndian64(ref buffer, ref state, (ulong)value); in WriteSFixed64()
386 … public static void WriteSInt32(ref Span<byte> buffer, ref WriterInternalState state, int value) in WriteSInt32()
388 WriteRawVarint32(ref buffer, ref state, EncodeZigZag32(value)); in WriteSInt32()
394 … public static void WriteSInt64(ref Span<byte> buffer, ref WriterInternalState state, long value) in WriteSInt64()
396 WriteRawVarint64(ref buffer, ref state, EncodeZigZag64(value)); in WriteSInt64()
405 … public static void WriteLength(ref Span<byte> buffer, ref WriterInternalState state, int length) in WriteLength()
407 WriteRawVarint32(ref buffer, ref state, (uint)length); in WriteLength()
418 …public static void WriteRawVarint32(ref Span<byte> buffer, ref WriterInternalState state, uint val… in WriteRawVarint32()
444 WriteRawByte(ref buffer, ref state, (byte)((value & 0x7F) | 0x80)); in WriteRawVarint32()
448 WriteRawByte(ref buffer, ref state, (byte)value); in WriteRawVarint32()
451 …public static void WriteRawVarint64(ref Span<byte> buffer, ref WriterInternalState state, ulong va… in WriteRawVarint64()
477 WriteRawByte(ref buffer, ref state, (byte)((value & 0x7F) | 0x80)); in WriteRawVarint64()
481 WriteRawByte(ref buffer, ref state, (byte)value); in WriteRawVarint64()
484 …public static void WriteRawLittleEndian32(ref Span<byte> buffer, ref WriterInternalState state, ui… in WriteRawLittleEndian32()
489 WriteRawLittleEndian32SlowPath(ref buffer, ref state, value); in WriteRawLittleEndian32()
499 …private static void WriteRawLittleEndian32SlowPath(ref Span<byte> buffer, ref WriterInternalState … in WriteRawLittleEndian32SlowPath()
501 WriteRawByte(ref buffer, ref state, (byte)value); in WriteRawLittleEndian32SlowPath()
502 WriteRawByte(ref buffer, ref state, (byte)(value >> 8)); in WriteRawLittleEndian32SlowPath()
503 WriteRawByte(ref buffer, ref state, (byte)(value >> 16)); in WriteRawLittleEndian32SlowPath()
504 WriteRawByte(ref buffer, ref state, (byte)(value >> 24)); in WriteRawLittleEndian32SlowPath()
507 …public static void WriteRawLittleEndian64(ref Span<byte> buffer, ref WriterInternalState state, ul… in WriteRawLittleEndian64()
512 WriteRawLittleEndian64SlowPath(ref buffer, ref state, value); in WriteRawLittleEndian64()
522 …public static void WriteRawLittleEndian64SlowPath(ref Span<byte> buffer, ref WriterInternalState s… in WriteRawLittleEndian64SlowPath()
524 WriteRawByte(ref buffer, ref state, (byte)value); in WriteRawLittleEndian64SlowPath()
525 WriteRawByte(ref buffer, ref state, (byte)(value >> 8)); in WriteRawLittleEndian64SlowPath()
526 WriteRawByte(ref buffer, ref state, (byte)(value >> 16)); in WriteRawLittleEndian64SlowPath()
527 WriteRawByte(ref buffer, ref state, (byte)(value >> 24)); in WriteRawLittleEndian64SlowPath()
528 WriteRawByte(ref buffer, ref state, (byte)(value >> 32)); in WriteRawLittleEndian64SlowPath()
529 WriteRawByte(ref buffer, ref state, (byte)(value >> 40)); in WriteRawLittleEndian64SlowPath()
530 WriteRawByte(ref buffer, ref state, (byte)(value >> 48)); in WriteRawLittleEndian64SlowPath()
531 WriteRawByte(ref buffer, ref state, (byte)(value >> 56)); in WriteRawLittleEndian64SlowPath()
534 … private static void WriteRawByte(ref Span<byte> buffer, ref WriterInternalState state, byte value) in WriteRawByte()
538 WriteBufferHelper.RefreshBuffer(ref buffer, ref state); in WriteRawByte()
547 …public static void WriteRawBytes(ref Span<byte> buffer, ref WriterInternalState state, byte[] valu… in WriteRawBytes()
549 WriteRawBytes(ref buffer, ref state, new ReadOnlySpan<byte>(value)); in WriteRawBytes()
555 …public static void WriteRawBytes(ref Span<byte> buffer, ref WriterInternalState state, byte[] valu… in WriteRawBytes()
557 WriteRawBytes(ref buffer, ref state, new ReadOnlySpan<byte>(value, offset, length)); in WriteRawBytes()
563 …public static void WriteRawBytes(ref Span<byte> buffer, ref WriterInternalState state, ReadOnlySpa… in WriteRawBytes()
586 WriteBufferHelper.RefreshBuffer(ref buffer, ref state); in WriteRawBytes()
601 …public static void WriteTag(ref Span<byte> buffer, ref WriterInternalState state, int fieldNumber,… in WriteTag()
603 WriteRawVarint32(ref buffer, ref state, WireFormat.MakeTag(fieldNumber, type)); in WriteTag()
609 public static void WriteTag(ref Span<byte> buffer, ref WriterInternalState state, uint tag) in WriteTag()
611 WriteRawVarint32(ref buffer, ref state, tag); in WriteTag()
617 … public static void WriteRawTag(ref Span<byte> buffer, ref WriterInternalState state, byte b1) in WriteRawTag()
619 WriteRawByte(ref buffer, ref state, b1); in WriteRawTag()
625 …public static void WriteRawTag(ref Span<byte> buffer, ref WriterInternalState state, byte b1, byte… in WriteRawTag()
629 WriteRawTagSlowPath(ref buffer, ref state, b1, b2); in WriteRawTag()
639 …private static void WriteRawTagSlowPath(ref Span<byte> buffer, ref WriterInternalState state, byte… in WriteRawTagSlowPath()
641 WriteRawByte(ref buffer, ref state, b1); in WriteRawTagSlowPath()
642 WriteRawByte(ref buffer, ref state, b2); in WriteRawTagSlowPath()
648 …public static void WriteRawTag(ref Span<byte> buffer, ref WriterInternalState state, byte b1, byte… in WriteRawTag()
652 WriteRawTagSlowPath(ref buffer, ref state, b1, b2, b3); in WriteRawTag()
663 …private static void WriteRawTagSlowPath(ref Span<byte> buffer, ref WriterInternalState state, byte… in WriteRawTagSlowPath()
665 WriteRawByte(ref buffer, ref state, b1); in WriteRawTagSlowPath()
666 WriteRawByte(ref buffer, ref state, b2); in WriteRawTagSlowPath()
667 WriteRawByte(ref buffer, ref state, b3); in WriteRawTagSlowPath()
673 …public static void WriteRawTag(ref Span<byte> buffer, ref WriterInternalState state, byte b1, byte… in WriteRawTag()
677 WriteRawTagSlowPath(ref buffer, ref state, b1, b2, b3, b4); in WriteRawTag()
690 …private static void WriteRawTagSlowPath(ref Span<byte> buffer, ref WriterInternalState state, byte… in WriteRawTagSlowPath()
692 WriteRawByte(ref buffer, ref state, b1); in WriteRawTagSlowPath()
693 WriteRawByte(ref buffer, ref state, b2); in WriteRawTagSlowPath()
694 WriteRawByte(ref buffer, ref state, b3); in WriteRawTagSlowPath()
695 WriteRawByte(ref buffer, ref state, b4); in WriteRawTagSlowPath()
701 …public static void WriteRawTag(ref Span<byte> buffer, ref WriterInternalState state, byte b1, byte… in WriteRawTag()
705 WriteRawTagSlowPath(ref buffer, ref state, b1, b2, b3, b4, b5); in WriteRawTag()
718 …private static void WriteRawTagSlowPath(ref Span<byte> buffer, ref WriterInternalState state, byte… in WriteRawTagSlowPath()
720 WriteRawByte(ref buffer, ref state, b1); in WriteRawTagSlowPath()
721 WriteRawByte(ref buffer, ref state, b2); in WriteRawTagSlowPath()
722 WriteRawByte(ref buffer, ref state, b3); in WriteRawTagSlowPath()
723 WriteRawByte(ref buffer, ref state, b4); in WriteRawTagSlowPath()
724 WriteRawByte(ref buffer, ref state, b5); in WriteRawTagSlowPath()