当前位置: 首页>>代码示例>>C#>>正文


C# ByteVector.Add方法代码示例

本文整理汇总了C#中ByteVector.Add方法的典型用法代码示例。如果您正苦于以下问题:C# ByteVector.Add方法的具体用法?C# ByteVector.Add怎么用?C# ByteVector.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ByteVector的用法示例。


在下文中一共展示了ByteVector.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RenderUniqueFields

		private ByteVector RenderUniqueFields()
		{
			ByteVector data = new ByteVector();

			data.Add(ByteVector.FromString(owner, StringType.Latin1));
			data.Add(TextDelimiter(StringType.Latin1));
			data.Add(identifier);

			return data;
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:10,代码来源:Id3v2UniqueFileIdentifierFrame.cs

示例2: SetCommentPacket

 public override void SetCommentPacket (ByteVectorCollection packets, XiphComment comment)
 {
    if (packets == null)
       throw new ArgumentNullException ("packets");
    
    if (comment == null)
       throw new ArgumentNullException ("comment");
    
    ByteVector data = new ByteVector ((byte) 0x03);
    data.Add (id);
    data.Add (comment.Render (true));
    if (packets.Count > 1 && PacketType (packets [1]) == 0x03)
       packets [1] = data;
    else
       packets.Insert (1, data);
 }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:16,代码来源:Vorbis.cs

示例3: RenderPrivateFields

		private ByteVector RenderPrivateFields()
		{
			ByteVector vector = new ByteVector();

			vector.Add(ByteVector.FromString(owner, StringType.Latin1));
			vector.Add(TextDelimiter(StringType.Latin1));
			vector.Add(data);

			return vector;
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:10,代码来源:Id3v2PrivateFrame.cs

示例4: Render

 public override ByteVector Render()
 {
     ByteVector data = new ByteVector();
     foreach (TagLib.Asf.Object obj2 in this.children)
     {
         data.Add(obj2.Render());
     }
     data.Insert(0, TagLib.Asf.Object.RenderDWord((uint) data.Count));
     data.Insert(0, TagLib.Asf.Object.RenderWord(6));
     data.Insert(0, TagLib.Asf.Guid.AsfReserved1.ToByteArray());
     return base.Render(data);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:12,代码来源:HeaderExtensionObject.cs

示例5: Render

 public override ByteVector Render()
 {
     ByteVector data = new ByteVector();
     uint num = 0;
     foreach (TagLib.Asf.Object obj2 in this.children)
     {
         if (obj2.Guid != TagLib.Asf.Guid.AsfPaddingObject)
         {
             data.Add(obj2.Render());
             num++;
         }
     }
     long num2 = (data.Count + 30L) - ((long) base.OriginalSize);
     if (num2 != 0)
     {
         data.Add(new PaddingObject((num2 <= 0L) ? ((uint) -num2) : ((uint) 0x1000L)).Render());
         num++;
     }
     data.Insert(0, this.reserved);
     data.Insert(0, TagLib.Asf.Object.RenderDWord(num));
     return base.Render(data);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:22,代码来源:HeaderObject.cs

示例6: Render

 public ByteVector Render()
 {
     ByteVector vector = new ByteVector {
         ByteVector.FromUInt((uint) this.Type)
     };
     ByteVector data = ByteVector.FromString(this.MimeType, StringType.Latin1);
     vector.Add(ByteVector.FromUInt((uint) data.Count));
     vector.Add(data);
     ByteVector vector3 = ByteVector.FromString(this.Description, StringType.UTF8);
     vector.Add(ByteVector.FromUInt((uint) vector3.Count));
     vector.Add(vector3);
     vector.Add(ByteVector.FromUInt((uint) this.Width));
     vector.Add(ByteVector.FromUInt((uint) this.Height));
     vector.Add(ByteVector.FromUInt((uint) this.ColorDepth));
     vector.Add(ByteVector.FromUInt((uint) this.IndexedColors));
     vector.Add(ByteVector.FromUInt((uint) this.Data.Count));
     vector.Add(this.Data);
     return vector;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:19,代码来源:Picture.cs

示例7: CreateDataString

		private string CreateDataString (int min_size)
		{
			string src = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

			ByteVector data = new ByteVector ();

			for (int i = 0; data.Count < min_size; i++)
			{
				int index = i % src.Length;
				data.Add (src.Substring (index, src.Length - index));
			}

			return data.ToString ();
		}
开发者ID:JohnThomson,项目名称:taglib-sharp,代码行数:14,代码来源:JpegSegmentSizeTest.cs

示例8: Save

		public override void Save ()
		{
			Mode = AccessMode.Write;
			try {
				ByteVector data = new ByteVector ();

				if (id32_tag != null) {
					ByteVector tag_data = id32_tag.Render ();
					if (tag_data.Count > 10) {
						if (tag_data.Count % 2 == 1)
							tag_data.Add (0);
						data.Add ("ID32");
						data.Add (ByteVector.FromUInt (
							(uint) tag_data.Count,
							false));
						data.Add (tag_data);
					}
				}

				if (info_tag != null)
					data.Add (info_tag.RenderEnclosed ());

				if (mid_tag != null)
					data.Add (mid_tag.RenderEnclosed ());

				if (divx_tag != null && !divx_tag.IsEmpty) {
					ByteVector tag_data = divx_tag.Render ();
					data.Add ("IDVX");
					data.Add (ByteVector.FromUInt (
						(uint) tag_data.Count, false));
					data.Add (tag_data);
				}

				uint riff_size;
				long tag_start, tag_end;
				Read (false, ReadStyle.None, out riff_size,
					out tag_start, out tag_end);

				if (tag_start < 12 || tag_end < tag_start)
					tag_start = tag_end = Length;

				int length = (int)(tag_end - tag_start);
				int padding_size = length - data.Count - 8;
				if (padding_size < 0)
					padding_size = 1024;

				data.Add ("JUNK");
				data.Add (ByteVector.FromUInt (
					(uint)padding_size, false));
				data.Add (new ByteVector (padding_size));

				Insert (data, tag_start, length);

				if (data.Count - length != 0 &&
					tag_start <= riff_size)
					Insert (ByteVector.FromUInt ((uint)
						(riff_size + data.Count - length),
						false), 4, 4);

				TagTypesOnDisk = TagTypes;
			} finally {
				Mode = AccessMode.Closed;
			}
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:64,代码来源:File.cs

示例9: Render

		/// <summary>
		///    Renders the current instance to a <see cref="ByteVector"/>
		/// </summary>
		/// <param name="is_bigendian">
		///    A <see cref="System.Boolean"/> indicating the endianess for rendering.
		/// </param>
		/// <param name="offset">
		///    A <see cref="System.UInt32"/> with the offset, the data is stored.
		/// </param>
		/// <param name="type">
		///    A <see cref="System.UInt16"/> the ID of the type, which is rendered
		/// </param>
		/// <param name="count">
		///    A <see cref="System.UInt32"/> with the count of the values which are
		///    rendered.
		/// </param>
		/// <returns>
		///    A <see cref="ByteVector"/> with the rendered data.
		/// </returns>
		public ByteVector Render (bool is_bigendian, uint offset, out ushort type, out uint count)
		{
			type = (ushort) IFDEntryType.SRational;
			count = 1;
			
			ByteVector data = new ByteVector ();
			data.Add (ByteVector.FromInt (Value.Numerator, is_bigendian));
			data.Add (ByteVector.FromInt (Value.Denominator, is_bigendian));
			
			return data;
		}
开发者ID:rubenv,项目名称:tripod,代码行数:30,代码来源:SRationalIFDEntry.cs

示例10: Render

		/// <summary>
		///    Renders the current instance as a raw ID3v2 header.
		/// </summary>
		/// <returns>
		///    A <see cref="ByteVector" /> object containing the
		///    rendered header.
		/// </returns>
		public ByteVector Render ()
		{
			ByteVector v = new ByteVector ();
			v.Add (FileIdentifier);
			v.Add (MajorVersion);
			v.Add (RevisionNumber);
			v.Add ((byte)flags);
			v.Add (SynchData.FromUInt (TagSize));
			return v;
		}
开发者ID:joconno4,项目名称:MediaPortal-2,代码行数:17,代码来源:Header.cs

示例11: Render

      public ByteVector Render ()
      {
         ByteVector data = new ByteVector ();

         data.Add ("OggS");
         data.Add (_version); // stream structure version
         data.Add ((byte) _flags);
         data.Add (ByteVector.FromULong (_absolute_granular_position, false));
         data.Add (ByteVector.FromUInt (_stream_serial_number, false));
         data.Add (ByteVector.FromUInt ((uint) _page_sequence_number, false));
         data.Add (new ByteVector (4, 0)); // checksum, to be filled in later.
         ByteVector page_segments = LacingValues;
         data.Add ((byte) page_segments.Count);
         data.Add (page_segments);

         return data;
      }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:17,代码来源:PageHeader.cs

示例12: RenderFields

		protected override ByteVector RenderFields (byte version) {
			if (raw_data != null && raw_version == version)
				return raw_data;
			
			StringType encoding = CorrectEncoding (TextEncoding,
				version);
			ByteVector v = new ByteVector ((byte) encoding);
			string [] text = text_fields;
			
			bool txxx = FrameId == FrameType.TXXX;
			
			if (version > 3 || txxx) {
				
				if (txxx) {
					if (text.Length == 0)
						text = new string [] {null, null};
					else if (text.Length == 1)
						text = new string [] {text [0],
							null};
				}
				
				for (int i = 0; i < text.Length; i++) {
					// Since the field list is null
					// delimited, if this is not the first
					// element in the list, append the
					// appropriate delimiter for this
					// encoding.
					
					if (i != 0)
						v.Add (ByteVector.TextDelimiter (
							encoding));
						
					if (text [i] != null)
						v.Add (ByteVector.FromString (
							text [i],
							encoding));
				}
			} else if (FrameId == FrameType.TCON) {
				byte id;
				bool prev_value_indexed = true;
				StringBuilder data = new StringBuilder ();
				foreach (string s in text) {
					if (!prev_value_indexed) {
						data.Append ("/").Append (s);
						continue;
					}
					
					if (prev_value_indexed =
						byte.TryParse (s, out id))
						data.AppendFormat (
							CultureInfo.InvariantCulture,
								"({0})", id);
					else
						data.Append (s);
				}
				
				v.Add (ByteVector.FromString (data.ToString (),
					encoding));
			} else {
				v.Add (ByteVector.FromString (
					string.Join ("/", text), encoding));
			}
			
			return v;
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:65,代码来源:TextIdentificationFrame.cs

示例13: Render

 public ByteVector Render()
 {
     ByteVector vector = new ByteVector();
     foreach (TagLib.Tag tag in this.Tags)
     {
         if (tag is TagLib.Ape.Tag)
         {
             vector.Add((tag as TagLib.Ape.Tag).Render());
         }
         else if (tag is TagLib.Id3v2.Tag)
         {
             vector.Add((tag as TagLib.Id3v2.Tag).Render());
         }
         else if (tag is TagLib.Id3v1.Tag)
         {
             vector.Add((tag as TagLib.Id3v1.Tag).Render());
         }
     }
     return vector;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:20,代码来源:EndTag.cs

示例14: Render

        /// <summary>
        ///    Renders the current instance as a raw Flac picture.
        /// </summary>
        /// <returns>
        ///    A <see cref="ByteVector" /> object containing the
        ///    rendered version of the current instance.
        /// </returns>
        public ByteVector Render()
        {
            ByteVector data = new ByteVector ();

            data.Add (ByteVector.FromUInt ((uint) Type));

            ByteVector mime_data = ByteVector.FromString (MimeType,
                StringType.Latin1);
            data.Add (ByteVector.FromUInt ((uint) mime_data.Count));
            data.Add (mime_data);

            ByteVector decription_data = ByteVector.FromString (
                Description, StringType.UTF8);
            data.Add (ByteVector.FromUInt ((uint)
                decription_data.Count));
            data.Add (decription_data);

            data.Add (ByteVector.FromUInt ((uint) Width));
            data.Add (ByteVector.FromUInt ((uint) Height));
            data.Add (ByteVector.FromUInt ((uint) ColorDepth));
            data.Add (ByteVector.FromUInt ((uint) IndexedColors));

            data.Add (ByteVector.FromUInt ((uint) Data.Count));
            data.Add (Data);

            return data;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:34,代码来源:Picture.cs

示例15: Render

        /// <summary>
        ///    Renders the tags contained in the current instance.
        /// </summary>
        /// <returns>
        ///    A <see cref="ByteVector" /> object containing the
        ///    physical representation of the tags stored in the current
        ///    instance.
        /// </returns>
        /// <remarks>
        ///    The tags are rendered in the order that they are stored
        ///    in the current instance.
        /// </remarks>
        public ByteVector Render()
        {
            ByteVector data = new ByteVector ();
            foreach (TagLib.Tag t in Tags) {
                if (t is TagLib.Ape.Tag)
                    data.Add ((t as TagLib.Ape.Tag).Render ());
                else if (t is TagLib.Id3v2.Tag)
                    data.Add ((t as TagLib.Id3v2.Tag).Render ());
                else if (t is TagLib.Id3v1.Tag)
                    data.Add ((t as TagLib.Id3v1.Tag).Render ());
            }

            return data;
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:26,代码来源:EndTag.cs


注:本文中的ByteVector.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。