public static FromUInt ( uint value ) : ByteVector | ||
value | uint |
/// A |
Результат | ByteVector |
public ByteVector Render(byte version) { ByteVector data = new ByteVector(); ByteVector id = ConvertId(frame_id, version, true); if (id == null) { throw new NotImplementedException(); } switch (version) { case 2: data.Add(id); data.Add(ByteVector.FromUInt(frame_size).Mid(1, 3)); return(data); case 3: ushort new_flags = (ushort)((((ushort)flags << 1) & 0xE000) | (((ushort)flags << 4) & 0x00C0) | (((ushort)flags >> 1) & 0x0020)); data.Add(id); data.Add(ByteVector.FromUInt(frame_size)); data.Add(ByteVector.FromUShort(new_flags)); return(data); case 4: data.Add(id); data.Add(SynchData.FromUInt(frame_size)); data.Add(ByteVector.FromUShort((ushort)flags)); return(data); default: throw new NotImplementedException("Unsupported tag version."); } }
/// <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); }
/// <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() { var v = new ByteVector { FileIdentifier, MajorVersion, RevisionNumber, (byte)flags, SynchData.FromUInt(TagSize) }; return(v); }