Lines Matching refs:buffer

52         internal static float? ReadFloatWrapperLittleEndian(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
57 // The entire wrapper message is already contained in `buffer`.
58 int length = buffer[state.bufferPos];
66 if (length != 5 || buffer[state.bufferPos + 1] != 13)
68 return ReadFloatWrapperSlow(ref buffer, ref state);
71 return ParsingPrimitives.ParseFloat(ref buffer, ref state);
75 return ReadFloatWrapperSlow(ref buffer, ref state);
79 internal static float? ReadFloatWrapperSlow(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
81 int length = ParsingPrimitives.ParseLength(ref buffer, ref state);
91 if (ParsingPrimitives.ParseTag(ref buffer, ref state) == 13)
93 result = ParsingPrimitives.ParseFloat(ref buffer, ref state);
97 ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state);
104 internal static double? ReadDoubleWrapperLittleEndian(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
109 // The entire wrapper message is already contained in `buffer`.
110 int length = buffer[state.bufferPos];
118 if (length != 9 || buffer[state.bufferPos + 1] != 9)
120 return ReadDoubleWrapperSlow(ref buffer, ref state);
123 return ParsingPrimitives.ParseDouble(ref buffer, ref state);
127 return ReadDoubleWrapperSlow(ref buffer, ref state);
131 internal static double? ReadDoubleWrapperSlow(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
133 int length = ParsingPrimitives.ParseLength(ref buffer, ref state);
143 if (ParsingPrimitives.ParseTag(ref buffer, ref state) == 9)
145 result = ParsingPrimitives.ParseDouble(ref buffer, ref state);
149 ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state);
156 internal static bool? ReadBoolWrapper(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
158 return ReadUInt64Wrapper(ref buffer, ref state) != 0;
161 internal static uint? ReadUInt32Wrapper(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
166 // The entire wrapper message is already contained in `buffer`.
168 int length = buffer[state.bufferPos++];
177 return ReadUInt32WrapperSlow(ref buffer, ref state);
181 if (buffer[state.bufferPos++] != 8)
184 return ReadUInt32WrapperSlow(ref buffer, ref state);
186 var result = ParsingPrimitives.ParseRawVarint32(ref buffer, ref state);
191 return ReadUInt32WrapperSlow(ref buffer, ref state);
197 return ReadUInt32WrapperSlow(ref buffer, ref state);
201 internal static uint? ReadUInt32WrapperSlow(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
203 int length = ParsingPrimitives.ParseLength(ref buffer, ref state);
213 if (ParsingPrimitives.ParseTag(ref buffer, ref state) == 8)
215 result = ParsingPrimitives.ParseRawVarint32(ref buffer, ref state);
219 ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state);
226 internal static int? ReadInt32Wrapper(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
228 return (int?)ReadUInt32Wrapper(ref buffer, ref state);
231 internal static ulong? ReadUInt64Wrapper(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
238 // The entire wrapper message is already contained in `buffer`.
240 int length = buffer[state.bufferPos++];
249 return ReadUInt64WrapperSlow(ref buffer, ref state);
252 if (buffer[state.bufferPos++] != expectedTag)
255 return ReadUInt64WrapperSlow(ref buffer, ref state);
257 var result = ParsingPrimitives.ParseRawVarint64(ref buffer, ref state);
262 return ReadUInt64WrapperSlow(ref buffer, ref state);
268 return ReadUInt64WrapperSlow(ref buffer, ref state);
272 internal static ulong? ReadUInt64WrapperSlow(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
276 int length = ParsingPrimitives.ParseLength(ref buffer, ref state);
285 if (ParsingPrimitives.ParseTag(ref buffer, ref state) == expectedTag)
287 result = ParsingPrimitives.ParseRawVarint64(ref buffer, ref state);
291 ParsingPrimitivesMessages.SkipLastField(ref buffer, ref state);
298 internal static long? ReadInt64Wrapper(ref ReadOnlySpan<byte> buffer, ref ParserInternalState state)
300 return (long?)ReadUInt64Wrapper(ref buffer, ref state);
305 return ParsingPrimitivesWrappers.ReadFloatWrapperLittleEndian(ref ctx.buffer, ref ctx.state);
310 return ParsingPrimitivesWrappers.ReadFloatWrapperSlow(ref ctx.buffer, ref ctx.state);
315 return ParsingPrimitivesWrappers.ReadDoubleWrapperLittleEndian(ref ctx.buffer, ref ctx.state);
320 return ParsingPrimitivesWrappers.ReadDoubleWrapperSlow(ref ctx.buffer, ref ctx.state);
325 return ParsingPrimitivesWrappers.ReadBoolWrapper(ref ctx.buffer, ref ctx.state);
330 return ParsingPrimitivesWrappers.ReadUInt32Wrapper(ref ctx.buffer, ref ctx.state);
335 return ParsingPrimitivesWrappers.ReadInt32Wrapper(ref ctx.buffer, ref ctx.state);
340 return ParsingPrimitivesWrappers.ReadUInt64Wrapper(ref ctx.buffer, ref ctx.state);
345 return ParsingPrimitivesWrappers.ReadUInt64WrapperSlow(ref ctx.buffer, ref ctx.state);
350 return ParsingPrimitivesWrappers.ReadInt64Wrapper(ref ctx.buffer, ref ctx.state);