System.Text.Decoder.GetChars C# (CSharp) Method

GetChars() public abstract method

public abstract GetChars ( byte bytes, int byteIndex, int byteCount, char chars, int charIndex ) : int
bytes byte
byteIndex int
byteCount int
chars char
charIndex int
return int
        public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount,
                                        char[] chars, int charIndex);

Same methods

Decoder::GetChars ( byte bytes, int byteCount, char chars, int charCount, bool flush ) : int
Decoder::GetChars ( byte bytes, int byteIndex, int byteCount, char chars, int charIndex, bool flush ) : int

Usage Example

示例#1
0
        private string Recieve(Socket RecieveSocket)
        {
            string[] Splitter;
            string   FullREC = "";

            byte[] buffer = new byte[RecieveSocket.Available];
            int    iRx    = RecieveSocket.Receive(buffer);

            char[] chars          = new char[iRx];
            System.Text.Decoder d = System.Text.Encoding.UTF8.GetDecoder();
            int charLen           = d.GetChars(buffer, 0, iRx, chars, 0);

            System.String Recieved = new System.String(chars);
            FullREC += Recieved;
            Splitter = FullREC.Split('\a');
            while (Splitter[Splitter.Length - 1] != "MSGEND")
            {
                buffer   = new byte[RecieveSocket.Available];
                iRx      = RecieveSocket.Receive(buffer);
                chars    = new char[iRx];
                charLen  = d.GetChars(buffer, 0, iRx, chars, 0);
                Recieved = new System.String(chars);
                FullREC += Recieved;
                Splitter = FullREC.Split('\a');
            }
            return(FullREC);
        }
All Usage Examples Of System.Text.Decoder::GetChars