|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--helliker.id3.ID3v2Tag
Constructor Summary | |
ID3v2Tag(java.io.File mp3,
long mpegOffset)
Create an id3v2 tag bound to the file provided as a parameter. |
Method Summary | |
void |
copyFrom(ID3Tag tag)
Copies information from the ID3Tag parameter and inserts it into this tag. |
byte[] |
getBytes()
Return a binary representation of this object to be written to a file. |
byte[] |
getFrameData(java.lang.String id)
Returns the data found in the frame specified by the id. |
java.lang.String |
getFrameDataString(java.lang.String id)
Returns the textual information contained in the frame specified by the id. |
int |
getPadding()
Returns the current number of padding bytes in this id3v2 tag. |
int |
getSize()
Returns the size of this id3v2 tag. |
int |
getTotalSize()
Returns the actual size of the tag when written. |
void |
removeFrame(java.lang.String id)
Remove the frame with the specified id from the file. |
void |
removeTag()
Remove an existing id3v2 tag from the file passed to the constructor. |
void |
setCommentFrame(java.lang.String description,
java.lang.String comment)
Set the data contained in the comments frame (COMM). |
void |
setPadding(int pad)
Set the amount of padding to use when writing this tag. |
void |
setTextFrame(java.lang.String id,
java.lang.String data)
Set the data contained in a text frame. |
void |
setURLFrame(java.lang.String id,
java.lang.String data)
Set the data contained in a URL frame. |
void |
setUserDefinedTextFrame(java.lang.String description,
java.lang.String value)
Sets the data contained in the user defined text frame (TXXX). |
void |
setUserDefinedURLFrame(java.lang.String description,
java.lang.String value)
Sets the data contained in the user defined url frame (WXXX). |
boolean |
tagExists()
Returns true if an id3v2 tag exists in the file that was passed to the constructor and false otherwise |
java.lang.String |
toString()
Return a string representation of this object. |
void |
updateFrameData(java.lang.String id,
byte[] data)
Updates the data for the frame specified by id. |
void |
writeTag()
Saves all the information in the tag to the file passed to the constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ID3v2Tag(java.io.File mp3, long mpegOffset) throws java.io.FileNotFoundException, java.io.IOException, ID3v2FormatException
mp3
- the file to write/read the the tag information to/frommpegOffset
- the byte offset where the mpeg frames begin
java.io.FileNotFoundException
- if an error occurs
java.io.IOException
- if an error occurs
ID3v2FormatException
- if an exisiting id3v2 tag isn't correctMethod Detail |
public void writeTag() throws java.io.FileNotFoundException, java.io.IOException
writeTag
in interface ID3Tag
java.io.FileNotFoundException
- if an error occurs
java.io.IOException
- if an error occurspublic void removeTag() throws java.io.FileNotFoundException, java.io.IOException
removeTag
in interface ID3Tag
java.io.FileNotFoundException
- if an error occurs
java.io.IOException
- if an error occurspublic byte[] getBytes()
getBytes
in interface ID3Tag
public void setTextFrame(java.lang.String id, java.lang.String data)
id
- the id of the frame to set the data fordata
- the data for the framepublic void setURLFrame(java.lang.String id, java.lang.String data)
id
- the id of the frame to set the data fordata
- the data for the framepublic void setUserDefinedTextFrame(java.lang.String description, java.lang.String value)
description
- a description of the datavalue
- the data for the framepublic void setUserDefinedURLFrame(java.lang.String description, java.lang.String value)
description
- a description of the urlvalue
- the url for the framepublic void setCommentFrame(java.lang.String description, java.lang.String comment)
description
- a description of the commentcomment
- the commentpublic void removeFrame(java.lang.String id)
id
- the id of the frame to removepublic void updateFrameData(java.lang.String id, byte[] data)
id
- the id of the frame to updatedata
- the data for the framepublic java.lang.String getFrameDataString(java.lang.String id) throws ID3v2FormatException
id
- the id of the frame to get text from
ID3v2FormatException
- if an error is encountered parsing datapublic byte[] getFrameData(java.lang.String id)
id
- the id of the frame to get the data from
public boolean tagExists()
public int getSize()
public int getTotalSize()
public int getPadding()
public void setPadding(int pad)
pad
- the amount of padding to use when writing this tagpublic java.lang.String toString()
toString
in class java.lang.Object
public void copyFrom(ID3Tag tag)
copyFrom
in interface ID3Tag
tag
- the tag to copy from
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |