protected override ByteVector RenderFields(byte version) { ByteVector data = ByteVector.FromULong(play_count); while (data.Count > 4 && data[0] == 0) { data.RemoveAt(0); } return(data); }
protected override ByteVector RenderFields(byte version) { ByteVector data = ByteVector.FromULong(play_count); while (data.Count > 0 && data[0] == 0) { data.RemoveAt(0); } data.Insert(0, rating); data.Insert(0, 0); data.Insert(0, ByteVector.FromString(user, StringType.Latin1)); return(data); }
public static void ResynchByteVector(ByteVector data) { if (data == null) { throw new ArgumentNullException("data"); } for (int i = data.Count - 2; i >= 0; i--) { if ((data[i] == 0xff) && (data[i + 1] == 0)) { data.RemoveAt(i + 1); } } }
/// <summary> /// Resynchronizes a <see cref="ByteVector" /> object by /// removing the added bytes. /// </summary> /// <param name="data"> /// A <see cref="ByteVector" /> object to resynchronize. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="data" /> is <see langword="null" />. /// </exception> public static void ResynchByteVector(ByteVector data) { if (data == null) { throw new ArgumentNullException("data"); } for (int i = data.Count - 2; i >= 0; i--) { if (data [i] == 0xFF && data [i + 1] == 0) { data.RemoveAt(i + 1); } } }
/// <summary> /// Resynchronizes a <see cref="ByteVector" /> object by /// removing the added bytes. /// </summary> /// <param name="data"> /// A <see cref="ByteVector" /> object to resynchronize. /// </param> /// <exception cref="ArgumentNullException"> /// <paramref name="data" /> is <see langword="null" />. /// </exception> public static void ResynchByteVector (ByteVector data) { if (data == null) throw new ArgumentNullException ("data"); for (int i = data.Count - 2; i >= 0; i --) if (data [i] == 0xFF && data [i+1] == 0) data.RemoveAt (i+1); }