SWFProcessing.SWFModeller.SWFDataTypeWriter.WriteString C# (CSharp) Method

WriteString() public method

Strings in SWF are zero-terminated.
public WriteString ( string s, bool write8BitLen = false ) : void
s string The string to write
write8BitLen bool Some weird parts of SWF have a zero-terminated /// string prefixed by a length. Yeah, I know.
return void
        public void WriteString(string s, bool write8BitLen = false)
        {
            this.Align8();
            byte[] utf8 = Encoding.UTF8.GetBytes(s);
            if (write8BitLen)
            {
                this.WriteUI8((uint)utf8.Length + 1);
            }
            this.Write(utf8, 0, utf8.Length);
            this.Write(0);
        }