17 references to Utf8Bom
System.Text.Json (17)
System\Text\Json\Document\JsonDocument.Parse.cs (4)
804
ReadOnlySpan<byte> utf8Bom = JsonConstants.
Utf8Bom
;
889
int utf8BomLength = JsonConstants.
Utf8Bom
.Length;
909
Debug.Assert(rented.Length >= JsonConstants.
Utf8Bom
.Length);
918
JsonConstants.
Utf8Bom
.SequenceEqual(rented.AsSpan(0, utf8BomLength)))
System\Text\Json\Serialization\PipeReadBufferState.cs (8)
85
if (_sequence.First.Length >= JsonConstants.
Utf8Bom
.Length)
87
if (_sequence.First.Span.StartsWith(JsonConstants.
Utf8Bom
))
89
_sequence = _sequence.Slice((byte)JsonConstants.
Utf8Bom
.Length);
97
while (matched < JsonConstants.
Utf8Bom
.Length && _sequence.TryGet(ref pos, out ReadOnlyMemory<byte> mem, advance: true))
100
for (int i = 0; i < span.Length && matched < JsonConstants.
Utf8Bom
.Length; i++, matched++)
102
if (span[i] != JsonConstants.
Utf8Bom
[matched])
110
if (matched == JsonConstants.
Utf8Bom
.Length)
112
_sequence = _sequence.Slice(JsonConstants.
Utf8Bom
.Length);
System\Text\Json\Serialization\StreamReadBufferState.cs (5)
46
_buffer = ArrayPool<byte>.Shared.Rent(Math.Max(initialBufferSize, JsonConstants.
Utf8Bom
.Length));
170
Debug.Assert(_buffer.Length >= JsonConstants.
Utf8Bom
.Length);
171
if (_buffer.AsSpan(0, _count).StartsWith(JsonConstants.
Utf8Bom
))
173
_offset = (byte)JsonConstants.
Utf8Bom
.Length;
174
_count -= JsonConstants.
Utf8Bom
.Length;