Ejemplo n.º 1
0
 private void writeTextFrame(BinaryWriter writer, string frameCode, string text)
 {
     writer.Write(Utils.Latin1Encoding.GetBytes(frameCode));
     byte[] textBytes = Encoding.UTF8.GetBytes(text);
     writer.Write(StreamUtils.EncodeBEUInt32((uint)textBytes.Length));
     writer.Write(textBytes);
 }
Ejemplo n.º 2
0
        private void writeCommentChunk(BinaryWriter w, MetaFieldInfo info, string comment = "")
        {
            byte[] commentData = null;

            if (null == info) // Plain string
            {
                w.Write(StreamUtils.EncodeBEUInt32(encodeTimestamp(DateTime.Now)));
                w.Write((short)0);
                commentData = Utils.Latin1Encoding.GetBytes(comment);
            }
            else
            {
                w.Write(StreamUtils.EncodeBEUInt32(((CommentData)info.SpecificData).Timestamp));
                w.Write(StreamUtils.EncodeBEInt16(((CommentData)info.SpecificData).MarkerId));
                commentData = Utils.Latin1Encoding.GetBytes(info.Value);
            }

            w.Write(StreamUtils.EncodeBEUInt16((ushort)commentData.Length));
            w.Write(commentData);
        }