BonCodeAJP13Namespace.BonCodeAJP13Packet.GetString C# (CSharp) Method

GetString() protected static method

Get the String value from the array starting from the position Pos
protected static GetString ( byte Data, string &Value, int Pos, int StrLength ) : int
Data byte
Value string
Pos int
StrLength int
return int
        protected static int GetString(byte[] Data, ref string Value, int Pos, int StrLength)
        {
            UInt16 StrRealLength = 0;
            GetUInt16(Data, ref StrRealLength, Pos);
            ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            Value = encoding.GetString(Data, Pos + 2, StrRealLength);
            return Pos + StrRealLength + 2;
        }