/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/Test/Core/FX/EncodingUtilities.cs
23 строки
717 B
Tomáš Matoušek
Hot Reload: Handle document deletes (#78516)
21 май 2025, 21:15
Не верифицирован
21 май 2025, 21:15
5623c07
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System.Text; namespace Roslyn.Test.Utilities { public static class EncodingExtensions { public static byte[] GetBytesWithPreamble(this Encoding encoding, string text) { var preamble = encoding.GetPreamble(); var content = encoding.GetBytes(text); byte[] bytes = new byte[preamble.Length + content.Length]; preamble.CopyTo(bytes, 0); content.CopyTo(bytes, preamble.Length); return bytes; } } }