System.Text.ASCIIEncoding.GetByteCount C# (CSharp) Method

GetByteCount() private method

private GetByteCount ( char chars, int count ) : int
chars char
count int
return int
        public unsafe override int GetByteCount(char* chars, int count)
        {
            throw null;
        }

Same methods

ASCIIEncoding::GetByteCount ( char chars, int index, int count ) : int
ASCIIEncoding::GetByteCount ( string chars ) : int

Usage Example

示例#1
0
    public bool Filename_9600()
    {
        string portName;
        int    baudRate = 9600;
        string fileName = portName = "PortNameEqualToFileName.txt";

        System.IO.FileStream      testFile  = System.IO.File.Open(fileName, System.IO.FileMode.Create);
        System.Text.ASCIIEncoding asciiEncd = new System.Text.ASCIIEncoding();
        string testStr  = "Hello World";
        bool   retValue = false;

        testFile.Write(asciiEncd.GetBytes(testStr), 0, asciiEncd.GetByteCount(testStr));
        testFile.Close();
        try
        {
            retValue = VerifyCtor(portName, baudRate, typeof(ArgumentException), ThrowAt.Open);
        }
        catch (Exception)
        {
            throw;
        }
        finally
        {
            System.IO.File.Delete(fileName);
        }
        return(retValue);
    }
All Usage Examples Of System.Text.ASCIIEncoding::GetByteCount