BonCodeAJP13.ServerPackets.BonCodeFilePathPacket.SetSimpleString C# (CSharp) Method

SetSimpleString() protected method

Set the String value in the array starting from the pos index The length prefix will be omitted. This is Adobe specific and we need to convert string type to ISO-8559-1
protected SetSimpleString ( byte data, string value, int pos ) : int
data byte
value string
pos int
return int
        protected override int SetSimpleString(byte[] data, string value, int pos)
        {
            //Adobe uses iso-8859-1 in its packets rather then UTF-8
            byte[] stringBytes = Encoding.GetEncoding("iso-8859-1").GetBytes(value);

            //set adobe file path bytes (this is not zero terminated)
            return SetSimpleByteArray(data, stringBytes, pos);
        }