All pastes #28490 Raw Edit

kikidonk

public text v1 · immutable
#28490 ·published 2005-11-12 21:52 UTC
rendered paste body
public void Delete(Stream raf, Stream tempRaf) {			OggTag tag = null;			try {				tag = (OggTag) reader.Read(raf);			} catch(CannotReadException e) {				Write(new OggTag(), raf, tempRaf);				return;			}						OggTag emptyTag = new OggTag();			if (tag.HasField("vendor"))				emptyTag.Set("vendor", tag.Get("vendor")[0]);						Write(emptyTag, raf, tempRaf);		}---------------------------------------------------public void Set(string id, string content) 		{			if (id == null || content == null)				return;			id = id.ToLower();						// If there is already an existing field with same id			// we update the first element			IList list = fields[id] as IList;			if(list != null && list.Count > 0) {				list [0] = content;				return;			}						// Else we put the new field in the fields.			list = new ArrayList();			list.Add(content);			fields[id] = list;		}		public void Set(CommonField id, string content)		{			Set(id.ToString(), content);		}