コード例 #1
0
        void writeSymbols(OutputBuffer o)
        {
            OutputBuffer chunk = new OutputBuffer();

            chunk.writeInt(symbols.Count);

            foreach (var symbol in symbols)
            {
                chunk.writeInt(symbol.Length);
                chunk.writeString(symbol);

                int padSize = 4 - (chunk.Size % 4);
                for (int i = 0; i < padSize; i++)
                {
                    chunk.writeByte(0);
                }
            }

            o.writeInt((int)TagType.Symbols);
            o.writeInt(chunk.Size / 4);
            o.write(chunk);
        }