Exemple #1
0
        /// <summary>
        /// Create a binary frame
        /// </summary>
        /// <returns>binary frame</returns>
        public override byte[] Make()
        {
            MemoryStream buffer = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(buffer);

            writer.Write(TextBuilder.WriteTextEnd(_url, TextCode.Ascii));
            return(buffer.ToArray());
        }
Exemple #2
0
        /// <summary>
        /// Create a text binary frame.
        /// </summary>
        /// <returns>binary frame</returns>
        public override byte[] Make()
        {
            MemoryStream buffer = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(buffer);

            writer.Write((byte)_textEncoding);
            writer.Write(TextBuilder.WriteTextEnd(_text, _textEncoding));
            return(buffer.ToArray());
        }
Exemple #3
0
        /// <summary>
        /// Create binary data from unsynchronised lyrics/comment frame
        /// </summary>
        /// <returns>binary frame data</returns>
        public override byte[] Make()
        {
            MemoryStream buffer = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(buffer);

            writer.Write((byte)_textEncoding);
            //TODO: Validate langage field
            byte[] language = TextBuilder.WriteASCII(_language);
            if (language.Length != 3)
            {
                writer.Write(new byte[] { (byte)'e', (byte)'n', (byte)'g' });
            }
            else
            {
                writer.Write(language, 0, 3);
            }
            writer.Write(TextBuilder.WriteText(_contents, _textEncoding));
            writer.Write(TextBuilder.WriteTextEnd(_text, _textEncoding));
            return(buffer.ToArray());
        }