public class ID3v2Tag extends Object
| Constructor and Description |
|---|
ID3v2Tag(RandomAccessInputStream raf)
Create an id3v2 tag bound to the file provided as a parameter.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBytes()
Return a binary representation of this object to be written to a file.
|
byte[] |
getFrameData(String id)
Returns the data found in the frame specified by the id.
|
String |
getFrameDataString(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.
|
void |
removeFrame(String id)
Remove the frame with the specified id from the file.
|
void |
removeTag(RandomAccessFile raf)
Remove an existing id3v2 tag from the file passed to the constructor.
|
void |
setCommentFrame(String description,
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(String id,
String data)
Set the data contained in a text frame.
|
void |
setURLFrame(String id,
String data)
Set the data contained in a URL frame.
|
void |
setUserDefinedTextFrame(String description,
String value)
Sets the data contained in the user defined text frame (TXXX).
|
void |
setUserDefinedURLFrame(String description,
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
|
String |
toString()
Return a string representation of this object.
|
void |
updateFrameData(String id,
byte[] data)
Updates the data for the frame specified by id.
|
void |
writeTag(RandomAccessFile raf)
Saves all the information in the tag to the file passed to the
constructor.
|
public ID3v2Tag(RandomAccessInputStream raf) throws FileNotFoundException, IOException, ID3v2FormatException
mp3 - the file to write/read the the tag information to/fromFileNotFoundException - if an error occursIOException - if an error occursID3v2FormatException - if an exisiting id3v2 tag isn't correctpublic void writeTag(RandomAccessFile raf) throws FileNotFoundException, IOException
FileNotFoundException - if an error occursIOException - if an error occurspublic void removeTag(RandomAccessFile raf) throws FileNotFoundException, IOException
FileNotFoundException - if an error occursIOException - if an error occurspublic byte[] getBytes()
public void setTextFrame(String id, String data)
id - the id of the frame to set the data fordata - the data for the framepublic void setURLFrame(String id, String data)
id - the id of the frame to set the data fordata - the data for the framepublic void setUserDefinedTextFrame(String description, String value)
description - a description of the datavalue - the data for the framepublic void setUserDefinedURLFrame(String description, String value)
description - a description of the urlvalue - the url for the framepublic void setCommentFrame(String description, String comment)
description - a description of the commentcomment - the commentpublic void removeFrame(String id)
id - the id of the frame to removepublic void updateFrameData(String id, byte[] data)
id - the id of the frame to updatedata - the data for the framepublic String getFrameDataString(String id)
id - the id of the frame to get text fromID3v2FormatException - if an error is encountered parsing datapublic byte[] getFrameData(String id)
id - the id of the frame to get the data frompublic boolean tagExists()
public int getSize()
public int getPadding()
public void setPadding(int pad)
pad - the amount of padding to use when writing this tagCopyright © 2014. All rights reserved.