Esempio n. 1
0
        /// <inheritdoc />
        public void Dispose()
        {
            var  temporary = (StreamDataDestination)_segment.Data;
            var  stream    = temporary.Stream;
            long length    = stream.Length;

            if (_isU2)
            {
                _destination.WriteU2((ushort)length);
            }
            else
            {
                _destination.WriteU4((uint)length);
            }

            stream.Seek(0, SeekOrigin.Begin);
            for (int i = 0; i < stream.Length; i++)
            {
                _destination.WriteU1((byte)stream.ReadByte());
            }

            temporary.Dispose();
        }
Esempio n. 2
0
 /// <summary>
 /// Writes the <see cref="ClassFileHeader"/> to the <paramref name="writer"/>.
 /// </summary>
 /// <param name="writer">The <see cref="IBigEndianWriter"/> to write the <see cref="ClassFileHeader"/> to.</param>
 public void Write(IBigEndianWriter writer)
 {
     writer.WriteU4(Magic);
     writer.WriteU2(Minor);
     writer.WriteU2(Major);
 }