Exemple #1
0
        // Token: 0x0600045B RID: 1115 RVA: 0x0000E0BC File Offset: 0x0000C2BC
        public void WriteChunk(string characterCode, Action <ABinaryWriter> writeMethod)
        {
            if (this.isDisposed)
            {
                throw new ObjectDisposedException("RIFFWriter");
            }
            if (writeMethod == null)
            {
                throw new ArgumentNullException("writeMethod");
            }
            this.binaryWriter.WriteString(RIFFWriter.ValidateCharacterCode(characterCode));
            this.binaryWriter.Write32(0U);
            long       position   = this.binaryWriter.Position;
            Endianness endianness = this.binaryWriter.Endianness;
            Encoding   encoding   = this.binaryWriter.Encoding;

            writeMethod(this.binaryWriter);
            this.binaryWriter.Endianness = endianness;
            this.binaryWriter.Encoding   = encoding;
            long num = this.binaryWriter.Position - position;

            this.binaryWriter.Goto(position - 4L);
            this.binaryWriter.Write32((uint)num);
            this.binaryWriter.Back();
            if (!this.options.HasFlag(RIFFWriterOptions.SkipAligment))
            {
                this.binaryWriter.Skip(2);
            }
        }
Exemple #2
0
        // Token: 0x0600045C RID: 1116 RVA: 0x0000E1A8 File Offset: 0x0000C3A8
        public void WriteLIST(string characterCode, Action writeMethod)
        {
            if (this.isDisposed)
            {
                throw new ObjectDisposedException("RIFFWriter");
            }
            if (writeMethod == null)
            {
                throw new ArgumentNullException("writeMethod");
            }
            this.binaryWriter.WriteString("LIST");
            this.binaryWriter.Write32(0U);
            long position = this.binaryWriter.Position;

            this.binaryWriter.WriteString(RIFFWriter.ValidateCharacterCode(characterCode));
            Endianness endianness = this.binaryWriter.Endianness;
            Encoding   encoding   = this.binaryWriter.Encoding;

            writeMethod();
            this.binaryWriter.Endianness = endianness;
            this.binaryWriter.Encoding   = encoding;
            long num = this.binaryWriter.Position - position;

            this.binaryWriter.Goto(position - 4L);
            this.binaryWriter.Write32((uint)num);
            this.binaryWriter.Back();
        }
Exemple #3
0
 // Token: 0x06000458 RID: 1112 RVA: 0x0000DFA0 File Offset: 0x0000C1A0
 public RIFFWriter(Stream stream, string characterCode, Endianness endianness, RIFFWriterOptions options)
 {
     this.binaryWriter = new ABinaryWriter(stream, endianness);
     this.options      = options;
     if (!options.HasFlag(RIFFWriterOptions.SkipHeader))
     {
         this.binaryWriter.WriteString("RIFF");
         this.binaryWriter.Write32(0U);
         this.startPosition = this.binaryWriter.Position;
         this.binaryWriter.WriteString(RIFFWriter.ValidateCharacterCode(characterCode));
     }
 }