Esempio n. 1
0
        /// <summary>
        /// Converts the given <paramref name="data"/> to it's byte array representation.
        /// The ChecksumedStream is on the same situation as <seealso cref="ProcessSubStream"/> the only difference
        /// is that instead of an extended size indicator there is only a checksum of the data in the stream
        ///
        /// The following opcodes are supported
        /// <seealso cref="Opcode.ChecksumedStream" /> 5 bytes minimum, Adler32 checksum, data is encoded as a normal Marshal string
        /// with header and save lists included
        /// </summary>
        /// <param name="writer">Where to write the encoded data to</param>
        /// <param name="data">The value to write</param>
        private static void ProcessChecksumedStream(BinaryWriter writer, PyChecksumedStream data)
        {
            byte[] buffer = ToByteArray(data.Data, false);

            uint checksum = Adler32.Checksum(buffer);

            writer.WriteOpcode(Opcode.ChecksumedStream);
            writer.Write(checksum);
            writer.Write(buffer);
        }
Esempio n. 2
0
        private void ProcessChecksumedStream(PyChecksumedStream stream)
        {
            this.mStringBuilder.Append("[PyChecksumedStream]");
            this.mStringBuilder.AppendLine();
            this.mIndentation++;

            this.Process(stream.Data);

            this.mIndentation--;
        }