164 {
165 fixed (
byte* ptr =
buffer)
166 {
167 byte* ptr2 = ptr +
offset;
168 byte* ptr3 = ptr2;
169 byte* ptr4 = ptr2;
170 byte* ptr5 = ptr2 +
count;
171 if (ReadState.IsEscaped)
172 {
173 if (ReadState.Byte == -1)
174 {
176 {
177 ReadState.Byte = *ptr3;
178 return 0;
179 }
180 if (*ptr3 != 13 || ptr3[1] != 10)
181 {
184 if (b == byte.MaxValue)
185 {
187 }
188 if (b2 == byte.MaxValue)
189 {
191 }
192 *(ptr4++) = (byte)((b << 4) + b2);
193 }
194 ptr3 += 2;
195 }
196 else
197 {
198 if (ReadState.Byte != 13 || *ptr3 != 10)
199 {
202 if (b3 == byte.MaxValue)
203 {
205 }
206 if (b4 == byte.MaxValue)
207 {
209 }
210 *(ptr4++) = (byte)((b3 << 4) + b4);
211 }
212 ptr3++;
213 }
214 ReadState.IsEscaped = false;
215 ReadState.Byte = -1;
216 }
217 while (ptr3 < ptr5)
218 {
219 if (*ptr3 != 61)
220 {
221 *(ptr4++) = *(ptr3++);
222 continue;
223 }
224 long num = ptr5 - ptr3;
225 if (num != 1)
226 {
227 if (num != 2)
228 {
229 if (ptr3[1] != 13 || ptr3[2] != 10)
230 {
233 if (b5 == byte.MaxValue)
234 {
236 }
237 if (b6 == byte.MaxValue)
238 {
240 }
241 *(ptr4++) = (byte)((b5 << 4) + b6);
242 }
243 ptr3 += 3;
244 continue;
245 }
246 ReadState.Byte = ptr3[1];
247 }
248 ReadState.IsEscaped = true;
249 break;
250 }
251 return (int)(ptr4 - ptr2);
252 }
253 }
static ReadOnlySpan< byte > HexDecodeMap
static string Format(string resourceFormat, object p1)
static string InvalidHexDigit