20 overrides of GetMaxByteCount
dotnet-svcutil-lib (3)
FrameworkFork\Microsoft.Xml\Xml\XmlEncoding.cs (1)
248public override int GetMaxByteCount(int charCount)
FrameworkFork\System.Runtime.Serialization\System\Text\Base64Encoding.cs (1)
37public override int GetMaxByteCount(int charCount)
FrameworkFork\System.Runtime.Serialization\System\Text\BinHexEncoding.cs (1)
35public override int GetMaxByteCount(int charCount)
Roslyn.VisualStudio.Next.UnitTests (1)
Remote\SnapshotSerializationTests.cs (1)
755public override int GetMaxByteCount(int charCount) => GetMaxByteCount(charCount);
System.Console (1)
src\libraries\Common\src\System\Text\ConsoleEncoding.cs (1)
153public override int GetMaxByteCount(int charCount)
System.Formats.Asn1 (3)
System\Formats\Asn1\AsnCharacterStringEncodings.cs (3)
244public override int GetMaxByteCount(int charCount) 400public override int GetMaxByteCount(int charCount) 517public override int GetMaxByteCount(int charCount)
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (1)
837public override int GetMaxByteCount(int charCount)
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (1)
152public override int GetMaxByteCount(int charCount)
src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (1)
1745public override int GetMaxByteCount(int charCount)
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (1)
1068public override int GetMaxByteCount(int charCount)
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (1)
724public override int GetMaxByteCount(int charCount)
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (1)
794public override int GetMaxByteCount(int charCount)
System.Private.DataContractSerialization (2)
System\Text\Base64Encoding.cs (1)
29public override int GetMaxByteCount(int charCount)
System\Text\BinHexEncoding.cs (1)
11public override int GetMaxByteCount(int charCount)
System.Private.Xml (1)
System\Xml\XmlEncoding.cs (1)
247public override int GetMaxByteCount(int charCount)
System.Text.Encoding.CodePages (3)
System\Text\DBCSCodePageEncoding.cs (1)
1118public override int GetMaxByteCount(int charCount)
System\Text\ISCIIEncoding.cs (1)
76public override int GetMaxByteCount(int charCount)
System\Text\SBCSCodePageEncoding.cs (1)
903public override int GetMaxByteCount(int charCount)
88 references to GetMaxByteCount
http2cat (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
IIS.FunctionalTests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
IIS.LongTests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
IIS.NewHandler.FunctionalTests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
IIS.NewShim.FunctionalTests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
IIS.ShadowCopy.Tests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
IISExpress.FunctionalTests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
InMemory.FunctionalTests (1)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
Microsoft.AspNetCore.Components.Server (1)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (1)
1213bufferSize = StringEncoding.UTF8.GetMaxByteCount(characterLength) + 5;
Microsoft.AspNetCore.Cryptography.KeyDerivation (2)
PBKDF2\Win7Pbkdf2Provider.cs (1)
30int cbPasswordBuffer = Encoding.UTF8.GetMaxByteCount(password.Length);
PBKDF2\Win8Pbkdf2Provider.cs (1)
64int cbPasswordBuffer = Encoding.UTF8.GetMaxByteCount(password.Length);
Microsoft.AspNetCore.Http.Abstractions (1)
Extensions\HttpResponseWritingExtensions.cs (1)
97return encoding.GetMaxByteCount(1);
Microsoft.AspNetCore.Server.HttpSys (1)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
Microsoft.AspNetCore.Server.IIS (2)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (1)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (1)
88int maxAlloc = checked(Encoding.UTF8.GetMaxByteCount(myString.Length) + 1);
Microsoft.AspNetCore.Shared.Tests (1)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
218var minBufferSize = encoding.GetMaxByteCount(1);
Microsoft.AspNetCore.WebUtilities (1)
HttpResponseStreamWriter.cs (1)
86var requiredLength = encoding.GetMaxByteCount(bufferSize);
Microsoft.Build (1)
InterningBinaryReader.cs (1)
287_byteBuffer ??= new byte[Encoding.UTF8.GetMaxByteCount(MaxCharsBuffer)];
Microsoft.Build.Tasks.Core (2)
Hash.cs (1)
76itemSpecChunkByteBuffer = System.Buffers.ArrayPool<byte>.Shared.Rent(s_encoding.GetMaxByteCount(MaxInputChunkLength));
InterningBinaryReader.cs (1)
287_byteBuffer ??= new byte[Encoding.UTF8.GetMaxByteCount(MaxCharsBuffer)];
Microsoft.CodeAnalysis (2)
EmbeddedText.cs (1)
303maxByteCount = text.Encoding.GetMaxByteCount(text.Length);
Text\SourceTextStream.cs (1)
38_minimumTargetBufferCount = _encoding.GetMaxByteCount(charCount: 1);
Microsoft.CodeAnalysis.UnitTests (2)
Text\SourceTextStreamTests.cs (1)
31var max = s_utf8NoBom.GetMaxByteCount(charCount: 1);
Text\StringTextDecodingTests.cs (1)
177Assert.Equal(2, sourceText.Encoding.GetMaxByteCount(1));
Microsoft.CodeAnalysis.Workspaces (1)
TemporaryStorage\TemporaryStorageService.cs (1)
114var size = Encoding.Unicode.GetMaxByteCount(text.Length);
Microsoft.Extensions.AI.OpenAI (1)
src\Shared\ServerSentEvents\Helpers.cs (1)
65int maxByteCount = Encoding.UTF8.GetMaxByteCount(value.Length);
Microsoft.ML.Core (1)
Utilities\TextReaderStream.cs (1)
81_buff = new byte[Math.Max(_encoding.GetByteCount("\n"), _encoding.GetMaxByteCount(_charBlockSize))];
Microsoft.ML.Tokenizers (17)
Model\BPETokenizer.cs (3)
1319int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(text.Length); 1432int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(text.Length); 1512int destinationMaxSize = Encoding.UTF8.GetMaxByteCount(text.Length);
Model\CodeGenTokenizer.cs (1)
1291int bytesCountToEncode = Encoding.UTF8.GetMaxByteCount(specialToken.Length);
Model\SentencePieceBpeModel.cs (4)
228int len = Encoding.UTF8.GetMaxByteCount(text.Length - i); 528int len = Encoding.UTF8.GetMaxByteCount(text.Length - i); 791int len = Encoding.UTF8.GetMaxByteCount(text.Length - i); 1067int len = Encoding.UTF8.GetMaxByteCount(text.Length - i);
Model\SentencePieceUnigramModel.cs (1)
294Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) * 3 <= buffer.Length * sizeof(int));
Model\TiktokenTokenizer.cs (4)
323int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length); 440int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length); 605int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length); 731int utf8Length = Encoding.UTF8.GetMaxByteCount(text.Length);
Utils\Helpers.cs (2)
70Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 162Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length);
Utils\OrdinalUtf8StringComparer.cs (2)
58int requiredLength1 = Encoding.UTF8.GetMaxByteCount(xLen); 59int requiredLength2 = Encoding.UTF8.GetMaxByteCount(yLen);
Microsoft.ML.Tokenizers.Tests (4)
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (2)
70Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 162Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length);
src\Microsoft.ML.Tokenizers\Utils\OrdinalUtf8StringComparer.cs (2)
58int requiredLength1 = Encoding.UTF8.GetMaxByteCount(xLen); 59int requiredLength2 = Encoding.UTF8.GetMaxByteCount(yLen);
MSBuild (1)
InterningBinaryReader.cs (1)
287_byteBuffer ??= new byte[Encoding.UTF8.GetMaxByteCount(MaxCharsBuffer)];
MSBuildTaskHost (1)
InterningBinaryReader.cs (1)
287_byteBuffer ??= new byte[Encoding.UTF8.GetMaxByteCount(MaxCharsBuffer)];
Shared (1)
ServerSentEvents\Helpers.cs (1)
65int maxByteCount = Encoding.UTF8.GetMaxByteCount(value.Length);
System.Console (2)
src\libraries\Common\src\System\Text\ConsoleEncoding.cs (1)
155return _encoding.GetMaxByteCount(charCount);
System\ConsolePal.Unix.cs (1)
1125data = stackalloc byte[Encoding.UTF8.GetMaxByteCount(value.Length)];
System.Data.Odbc (2)
System\Data\Odbc\OdbcParameter.cs (2)
370cch = System.Text.Encoding.Default.GetMaxByteCount(cch); 384cch = System.Text.Encoding.Default.GetMaxByteCount(cch);
System.Diagnostics.Process (1)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
26int maxSize = checked(Encoding.UTF8.GetMaxByteCount(value.Length) + 1);
System.IO.Compression (1)
System\IO\Compression\ZipHelper.cs (1)
215if (isUTF8 && encoding.GetMaxByteCount(text.Length) > maxBytes)
System.IO.Ports (3)
System\IO\Ports\SerialPort.cs (3)
45private int _maxByteCountForSingleChar = Encoding.ASCII.GetMaxByteCount(1); 316_maxByteCountForSingleChar = _encoding.GetMaxByteCount(1); 865int maxReadSize = Encoding.GetMaxByteCount(count);
System.Net.Http (3)
System\Net\Http\Headers\HeaderUtilities.cs (1)
71byte[] utf8bytes = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(input.Length));
System\Net\Http\MultipartContent.cs (1)
646int maxLength = encoding.GetMaxByteCount(content.Length);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
523_writeBuffer.EnsureAvailableSpace(encoding.GetMaxByteCount(s.Length));
System.Net.HttpListener (1)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
85Encoding.UTF8.GetMaxByteCount(statusDescription.Length) > MaxControlFramePayloadLength &&
System.Net.Mail (1)
System\Net\Mime\ByteEncoder.cs (1)
73buffer = new byte[encoding.GetMaxByteCount(2)];
System.Net.Ping (1)
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
26int maxSize = checked(Encoding.UTF8.GetMaxByteCount(value.Length) + 1);
System.Net.ServerSentEvents (1)
System\Net\ServerSentEvents\Helpers.cs (1)
48int maxByteCount = Encoding.UTF8.GetMaxByteCount(value.Length);
System.Net.WebSockets (1)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
85Encoding.UTF8.GetMaxByteCount(statusDescription.Length) > MaxControlFramePayloadLength &&
System.Net.WebSockets.Client (1)
src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
85Encoding.UTF8.GetMaxByteCount(statusDescription.Length) > MaxControlFramePayloadLength &&
System.Private.CoreLib (6)
src\libraries\System.Private.CoreLib\src\System\IO\BinaryWriter.cs (1)
194int maxByteCount = _encoding.GetMaxByteCount(1);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (1)
1577byte[] bytes = ArrayPool<byte>.Shared.Rent(preambleSize + encoding.GetMaxByteCount(Math.Min(contents.Length, ChunkSize)));
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (3)
307int maxBytesForCharPos = _encoding.GetMaxByteCount(_charPos); 310(_byteBuffer = new byte[_encoding.GetMaxByteCount(_charBuffer.Length)]); 990byte[] byteBuffer = _byteBuffer ??= new byte[_encoding.GetMaxByteCount(_charBuffer.Length)];
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (1)
201_readBuffer = GC.AllocateUninitializedArray<byte>(_thisEncoding.GetMaxByteCount(_readCharBufferMaxSize));
System.Private.Xml (1)
System\Xml\Xsl\XsltOld\SequentialOutput.cs (1)
610_byteBuffer = new byte[_utf8Encoding.GetMaxByteCount(1)];
System.Security.Cryptography (2)
src\libraries\Common\src\System\Security\Cryptography\Utf8DataEncoding.cs (1)
17int maxLength = ThrowingUtf8Encoding.GetMaxByteCount(data.Length);
src\libraries\Common\src\System\Text\ValueUtf8Converter.cs (1)
26int maxSize = checked(Encoding.UTF8.GetMaxByteCount(value.Length) + 1);
System.Web.HttpUtility (3)
System\Web\HttpUtility.cs (1)
204if (e.GetMaxByteCount(str.Length) <= StackallocThreshold)
System\Web\Util\HttpEncoder.cs (2)
461if (e.GetMaxByteCount(str.Length) <= StackallocThreshold) 569byte[] bytes = ArrayPool<byte>.Shared.Rent(Encoding.UTF8.GetMaxByteCount(toEncode.Length));