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); }
public override void protect(GenericTag tag) { open(tag); if (tag.data != null) out_Renamed.Write(" password='******'"); close(); }
public override void jpegTables(GenericTag tag) { tags.Add(tag); }
public override void jpegTables(GenericTag tag) { open(tag); out_Renamed.Write(" encoding='base64'"); end(); outputBase64(tag.data); close(tag); }
public override void soundStreamBlock(GenericTag tag) { open(tag); close(); }
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) + " -->"); }
public virtual void jpegTables(GenericTag tag) { }
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); } }
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); }
public override void protect(GenericTag tag) { tags.Add(tag); }
public override void unknown(GenericTag tag) { tags.Add(tag); }
public virtual void soundStreamBlock(GenericTag tag) { }