📄 id3v2tag.html
字号:
will be written to when the writeTag method is called.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mp3</CODE> - the file to write/read the the tag information to/from<DT><B>Throws:</B><DD><CODE>java.io.FileNotFoundException</CODE> - if an error occurs<DD><CODE>java.io.IOException</CODE> - if an error occurs<DD><CODE><A HREF="../../helliker/id3/ID3v2FormatException.html">ID3v2FormatException</A></CODE> - if an exisiting id3v2 tag isn't correct</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="writeTag()"><!-- --></A><H3>
writeTag</H3>
<PRE>
public void <B>writeTag</B>() throws java.io.FileNotFoundException, java.io.IOException</PRE>
<DL>
<DD>Saves all the information in the tag to the file passed to the constructor. If a tag doesn't exist, a tag is prepended to the file. If the padding has not changed since the creation of this object and the size is less than the original size + the original padding, then the previous tag and part of the previous padding will be overwritten. Otherwise, a new tag will be prepended to the file.<DD><DL>
<DT><B>Returns:</B><DD>true if the tag was successfully written<DT><B>Throws:</B><DD><CODE>java.io.FileNotFoundException</CODE> - if an error occurs<DD><CODE>java.io.IOException</CODE> - if an error occurs</DL>
</DD>
</DL>
<HR>
<A NAME="removeTag()"><!-- --></A><H3>
removeTag</H3>
<PRE>
public void <B>removeTag</B>() throws java.io.FileNotFoundException, java.io.IOException</PRE>
<DL>
<DD>Remove an existing id3v2 tag from the file passed to the constructor.<DD><DL>
<DT><B>Returns:</B><DD>true if the removal was a success<DT><B>Throws:</B><DD><CODE>java.io.FileNotFoundException</CODE> - if an error occurs<DD><CODE>java.io.IOException</CODE> - if an error occurs</DL>
</DD>
</DL>
<HR>
<A NAME="getBytes()"><!-- --></A><H3>
getBytes</H3>
<PRE>
public byte[] <B>getBytes</B>()</PRE>
<DL>
<DD>Return a binary representation of this object to be written to a file. This is in the format of the id3v2 specifications. This includes the header, extended header (if it exists), the frames, padding (if it exists), and a footer (if it exists).<DD><DL>
<DT><B>Returns:</B><DD>a binary representation of this id3v2 tag</DL>
</DD>
</DL>
<HR>
<A NAME="setTextFrame(java.lang.String, java.lang.String)"><!-- --></A><H3>
setTextFrame</H3>
<PRE>
public void <B>setTextFrame</B>(java.lang.String id, java.lang.String data)</PRE>
<DL>
<DD>Set the data contained in a text frame. This includes all frames with an id that starts with 'T' but excludes "TXXX". If an improper id is passed, then nothing will happen.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the id of the frame to set the data for<DD><CODE>data</CODE> - the data for the frame</DL>
</DD>
</DL>
<HR>
<A NAME="setURLFrame(java.lang.String, java.lang.String)"><!-- --></A><H3>
setURLFrame</H3>
<PRE>
public void <B>setURLFrame</B>(java.lang.String id, java.lang.String data)</PRE>
<DL>
<DD>Set the data contained in a URL frame. This includes all frames with an id that starts with 'W' but excludes "WXXX". If an improper id is passed, then nothing will happen.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the id of the frame to set the data for<DD><CODE>data</CODE> - the data for the frame</DL>
</DD>
</DL>
<HR>
<A NAME="setUserDefinedTextFrame(java.lang.String, java.lang.String)"><!-- --></A><H3>
setUserDefinedTextFrame</H3>
<PRE>
public void <B>setUserDefinedTextFrame</B>(java.lang.String description, java.lang.String value)</PRE>
<DL>
<DD>Sets the data contained in the user defined text frame (TXXX).<DD><DL>
<DT><B>Parameters:</B><DD><CODE>description</CODE> - a description of the data<DD><CODE>value</CODE> - the data for the frame</DL>
</DD>
</DL>
<HR>
<A NAME="setUserDefinedURLFrame(java.lang.String, java.lang.String)"><!-- --></A><H3>
setUserDefinedURLFrame</H3>
<PRE>
public void <B>setUserDefinedURLFrame</B>(java.lang.String description, java.lang.String value)</PRE>
<DL>
<DD>Sets the data contained in the user defined url frame (WXXX).<DD><DL>
<DT><B>Parameters:</B><DD><CODE>description</CODE> - a description of the url<DD><CODE>value</CODE> - the url for the frame</DL>
</DD>
</DL>
<HR>
<A NAME="setCommentFrame(java.lang.String, java.lang.String)"><!-- --></A><H3>
setCommentFrame</H3>
<PRE>
public void <B>setCommentFrame</B>(java.lang.String description, java.lang.String comment)</PRE>
<DL>
<DD>Set the data contained in the comments frame (COMM).<DD><DL>
<DT><B>Parameters:</B><DD><CODE>description</CODE> - a description of the comment<DD><CODE>comment</CODE> - the comment</DL>
</DD>
</DL>
<HR>
<A NAME="removeFrame(java.lang.String)"><!-- --></A><H3>
removeFrame</H3>
<PRE>
public void <B>removeFrame</B>(java.lang.String id)</PRE>
<DL>
<DD>Remove the frame with the specified id from the file. If there is no frame with that id nothing will happen.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the id of the frame to remove</DL>
</DD>
</DL>
<HR>
<A NAME="updateFrameData(java.lang.String, byte[])"><!-- --></A><H3>
updateFrameData</H3>
<PRE>
public void <B>updateFrameData</B>(java.lang.String id, byte[] data)</PRE>
<DL>
<DD>Updates the data for the frame specified by id. If no frame exists for the id specified, a new frame with that id is created.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the id of the frame to update<DD><CODE>data</CODE> - the data for the frame</DL>
</DD>
</DL>
<HR>
<A NAME="getFrameDataString(java.lang.String)"><!-- --></A><H3>
getFrameDataString</H3>
<PRE>
public java.lang.String <B>getFrameDataString</B>(java.lang.String id) throws <A HREF="../../helliker/id3/ID3v2FormatException.html">ID3v2FormatException</A></PRE>
<DL>
<DD>Returns the textual information contained in the frame specified by the id. Not every type of frame has textual information. If an id is specified that will not work, the empty string is returned.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the id of the frame to get text from<DT><B>Returns:</B><DD>the text information contained in the frame<DT><B>Throws:</B><DD><CODE><A HREF="../../helliker/id3/ID3v2FormatException.html">ID3v2FormatException</A></CODE> - if an error is encountered parsing data</DL>
</DD>
</DL>
<HR>
<A NAME="getFrameData(java.lang.String)"><!-- --></A><H3>
getFrameData</H3>
<PRE>
public byte[] <B>getFrameData</B>(java.lang.String id)</PRE>
<DL>
<DD>Returns the data found in the frame specified by the id. If the frame doesn't exist, then a zero length array is returned.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - the id of the frame to get the data from<DT><B>Returns:</B><DD>the data found in the frame</DL>
</DD>
</DL>
<HR>
<A NAME="tagExists()"><!-- --></A><H3>
tagExists</H3>
<PRE>
public boolean <B>tagExists</B>()</PRE>
<DL>
<DD>Returns true if an id3v2 tag exists in the file that was passed to the constructor and false otherwise<DD><DL>
<DT><B>Returns:</B><DD>true if an id3v2 tag exists in the file passed to the ctor</DL>
</DD>
</DL>
<HR>
<A NAME="getSize()"><!-- --></A><H3>
getSize</H3>
<PRE>
public int <B>getSize</B>()</PRE>
<DL>
<DD>Returns the size of this id3v2 tag. This includes the header, extended header, frames, padding, and footer.<DD><DL>
<DT><B>Returns:</B><DD>the size (in bytes) of the entire id3v2 tag</DL>
</DD>
</DL>
<HR>
<A NAME="getPadding()"><!-- --></A><H3>
getPadding</H3>
<PRE>
public int <B>getPadding</B>()</PRE>
<DL>
<DD>Returns the current number of padding bytes in this id3v2 tag.<DD><DL>
<DT><B>Returns:</B><DD>the current number of padding bytes in this id3v2 tag</DL>
</DD>
</DL>
<HR>
<A NAME="setPadding(int)"><!-- --></A><H3>
setPadding</H3>
<PRE>
public void <B>setPadding</B>(int pad)</PRE>
<DL>
<DD>Set the amount of padding to use when writing this tag. There cannot be any padding if a footer exists. Nothing will happen if this function is called and a footer exists or if the number is negative.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pad</CODE> - the amount of padding to use when writing this tag</DL>
</DD>
</DL>
<HR>
<A NAME="toString()"><!-- --></A><H3>
toString</H3>
<PRE>
public java.lang.String <B>toString</B>()</PRE>
<DL>
<DD>Return a string representation of this object. This includes all data contained in all parts of this tag.<DD><DL>
<DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a string representation of this object</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../helliker/id3/ID3v2Header.html"><B>PREV CLASS</B></A>
<A HREF="../../helliker/id3/MP3Comparator.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="ID3v2Tag.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -