////------------------------------------------------------------------------------------------------------------------------------
 /// <inheritdoc />
 public override byte[] ToByteArray()
 {
     using (StreamBuffer sb = new StreamBuffer())
     {
         sb.Write(base.ToByteArray());
         sb.WriteBigEndianBytes(UnencodedConstantValue, SampleSize / 8);
         return sb.ToByteArray();
     }
 }
Beispiel #2
0
        /// <inheritdoc/>
        public override byte[] ToByteArray()
        {
            using (StreamBuffer buffer = new StreamBuffer())
            {
                buffer.WriteString(Name);
                buffer.WriteBigEndianInt16(Version);
                buffer.WriteBigEndianInt16((short)_delay);
                buffer.WriteBigEndianInt16((short)Quality);
                buffer.WriteBigEndianInt32(FileSize);
                buffer.WriteBigEndianInt32(FrameCount);
                buffer.WriteBigEndianInt16(TableEntries);
                buffer.WriteBigEndianInt16(TableScale);
                buffer.WriteBigEndianInt16(TableEntrySize);
                buffer.WriteBigEndianInt16(FramesPerTableEntry);
                for (int i = 0; i <= TableEntries; i++)
                    buffer.WriteBigEndianBytes(Toc[i] / TableScale, TableEntrySize);

                return buffer.ToByteArray();
            }
        }
 /// <summary>
 /// Returns the metadata block in a byte array.
 /// </summary>
 /// <returns>The frame in a byte array.</returns>
 public byte[] ToByteArray()
 {
     using (StreamBuffer buffer = new StreamBuffer())
     {
         buffer.WriteBigEndianBytes(Flags, 1);
         buffer.WriteBigEndianBytes(Data.Length, 3);
         buffer.Write(Data);
         return buffer.ToByteArray();
     }
 }
 public void WriteBigEndianBytesTest()
 {
     StreamBuffer target = new StreamBuffer(); // TODO: Initialize to an appropriate value
     long value = 0; // TODO: Initialize to an appropriate value
     int size = 0; // TODO: Initialize to an appropriate value
     target.WriteBigEndianBytes(value, size);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }