FSO.Files.Formats.IFF.Chunks.STR.Write C# (CSharp) Method

Write() public method

public Write ( IffFile iff, Stream stream ) : bool
iff IffFile
stream Stream
return bool
        public override bool Write(IffFile iff, Stream stream)
        {
            using (var io = IoWriter.FromStream(stream, ByteOrder.LITTLE_ENDIAN))
            {
                io.WriteInt16(-4);
                io.WriteByte(20);

                foreach (var set in LanguageSets)
                {
                    io.WriteUInt16((ushort)set.Strings.Length);
                    foreach (var str in set.Strings)
                    {
                        io.WriteByte((byte)(str.LanguageCode - 1));
                        io.WriteVariableLengthPascalString(str.Value);
                        io.WriteVariableLengthPascalString(str.Comment);
                    }
                }

                return true;
            }
        }