151 {
152 fixed (
byte* ptr =
buffer)
153 {
154 byte* ptr2 = ptr +
offset;
155 byte* ptr3 = ptr2;
156 byte* ptr4 = ptr2;
157 byte* ptr5 = ptr2 +
count;
158 if (ReadState.IsEscaped)
159 {
160 if (ReadState.Byte == -1)
161 {
163 {
164 ReadState.Byte = *ptr3;
165 return 0;
166 }
167 if (*ptr3 != 13 || ptr3[1] != 10)
168 {
171 if (b == byte.MaxValue)
172 {
174 }
175 if (b2 == byte.MaxValue)
176 {
178 }
179 *(ptr4++) = (byte)((b << 4) + b2);
180 }
181 ptr3 += 2;
182 }
183 else
184 {
185 if (ReadState.Byte != 13 || *ptr3 != 10)
186 {
189 if (b3 == byte.MaxValue)
190 {
192 }
193 if (b4 == byte.MaxValue)
194 {
196 }
197 *(ptr4++) = (byte)((b3 << 4) + b4);
198 }
199 ptr3++;
200 }
201 ReadState.IsEscaped = false;
202 ReadState.Byte = -1;
203 }
204 while (ptr3 < ptr5)
205 {
206 if (*ptr3 != 61)
207 {
208 if (*ptr3 == 95)
209 {
210 *(ptr4++) = 32;
211 ptr3++;
212 }
213 else
214 {
215 *(ptr4++) = *(ptr3++);
216 }
217 continue;
218 }
219 long num = ptr5 - ptr3;
220 if (num != 1)
221 {
222 if (num != 2)
223 {
224 if (ptr3[1] != 13 || ptr3[2] != 10)
225 {
228 if (b5 == byte.MaxValue)
229 {
231 }
232 if (b6 == byte.MaxValue)
233 {
235 }
236 *(ptr4++) = (byte)((b5 << 4) + b6);
237 }
238 ptr3 += 3;
239 continue;
240 }
241 ReadState.Byte = ptr3[1];
242 }
243 ReadState.IsEscaped = true;
244 break;
245 }
246 return (int)(ptr4 - ptr2);
247 }
248 }
static ReadOnlySpan< byte > HexDecodeMap
static string Format(string resourceFormat, object p1)
static string InvalidHexDigit