public AudioFile Read(string f)
        {
            FileInfo finfo = new FileInfo(f);

            if(finfo.Length <= 150)
                throw new CannotReadException("Less than 150 byte \""+f+"\"");

            Stream raf = null;
            try{
                raf = finfo.OpenRead ();
                raf.Seek( 0, SeekOrigin.Begin );

                EncodingInfo info = GetEncodingInfo(raf);

                Tag tag;
                try {
                    raf.Seek( 0, SeekOrigin.Begin );
                    tag = GetTag(raf);
                } catch (CannotReadException e) {
                    tag = new GenericTag();
                }

                return new AudioFile(f, info, tag);
            } catch ( Exception e ) {
                throw new CannotReadException("\""+f+"\" :"+e);
            }
            finally {
                try{
                    if(raf != null)
                            raf.Close();
                }catch(Exception ex){
                    /* We tried everything... */
                }
            }
        }
        public override void  protect(GenericTag tag)
        {
            if (m.protect != null)
            {
                error("duplicate Protect ");
            }

            m.protect = tag;
        }
 public override void  unknown(GenericTag tag)
 {
     frame.controlTags.Add(tag);
 }
 public override void  soundStreamBlock(GenericTag tag)
 {
     frame.controlTags.Add(tag);
 }
 public virtual void  protect(GenericTag tag)
 {
 }
		public override void  unknown(GenericTag tag)
		{
			encodeTagHeader(tag.code, tag.data.Length, false);
			writer.write(tag.data);
		}
示例#7
0
		public override void  soundStreamBlock(GenericTag tag)
		{
			frame.controlTags.Add(tag);
		}
示例#8
0
		public override void  protect(GenericTag tag)
		{
			open(tag);
			if (tag.data != null)
				out_Renamed.Write(" password='******'");
			close();
		}
示例#9
0
 public override void  jpegTables(GenericTag tag)
 {
     tags.Add(tag);
 }
示例#10
0
		public override void  jpegTables(GenericTag tag)
		{
			open(tag);
			out_Renamed.Write(" encoding='base64'");
			end();
			outputBase64(tag.data);
			close(tag);
		}
示例#11
0
		public override void  soundStreamBlock(GenericTag tag)
		{
			open(tag);
			close();
		}
示例#12
0
		public override void  unknown(GenericTag tag)
		{
			indent();
			//UPGRADE_TODO: Method 'java.io.PrintWriter.println' was converted to 'System.IO.TextWriter.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintWriterprintln_javalangString'"
			out_Renamed.WriteLine("<!-- unknown tag=" + tag.code + " length=" + (tag.data != null?tag.data.Length:0) + " -->");
		}
示例#13
0
 public virtual void  jpegTables(GenericTag tag)
 {
 }
示例#14
0
 public virtual void  unknown(GenericTag tag)
 {
 }
		public override void  protect(GenericTag tag)
		{
			if (tag.data != null)
			{
				encodeTagHeader(tag.code, tag.data.Length, false);
				writer.write(tag.data);
			}
			else
			{
				encodeTagHeader(tag.code, 0, false);
			}
		}
示例#16
0
 public override void  soundStreamBlock(GenericTag tag)
 {
     tags.Add(tag);
 }
		public override void  soundStreamBlock(GenericTag tag)
		{
			encodeTagHeader(tag.code, tag.data.Length, false);
			writer.write(tag.data);
		}
示例#18
0
 public override void  protect(GenericTag tag)
 {
     tags.Add(tag);
 }
示例#19
0
		public override void  protect(GenericTag tag)
		{
			if (m.protect != null)
			{
				error("duplicate Protect ");
			}
			
			m.protect = tag;
		}
示例#20
0
 public override void  unknown(GenericTag tag)
 {
     tags.Add(tag);
 }
示例#21
0
		public override void  unknown(GenericTag tag)
		{
			frame.controlTags.Add(tag);
		}
示例#22
0
 public virtual void  soundStreamBlock(GenericTag tag)
 {
 }