/// <summary> /// Create a binary UFID frame /// </summary> /// <returns>binary frame</returns> public override byte[] Make() { MemoryStream buffer = new MemoryStream(); BinaryWriter writer = new BinaryWriter(buffer); writer.Write(TextBuilder.WriteASCII(_description)); writer.Write(_identifer); return(buffer.ToArray()); }
/// <summary> /// Save picture frame to binary data /// </summary> /// <returns>picture binary representation</returns> public override byte[] Make() { MemoryStream buffer = new MemoryStream(); BinaryWriter writer = new BinaryWriter(buffer); writer.Write((byte)_textEncoding); writer.Write(TextBuilder.WriteASCII(_mime)); writer.Write((byte)_pictureType); writer.Write(TextBuilder.WriteText(_description, _textEncoding)); writer.Write(_pictureData); return(buffer.ToArray()); }
/// <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()); }