|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.vdheide.mp3.ID3v2
Instances of this class contain an ID3v2 tag
Notes:
| Field Summary | |
static byte |
REVISION
ID3v2 revision |
static byte |
VERSION
ID3v2 version |
| Constructor Summary | |
ID3v2(java.io.File file)
Provides access to file's ID3v2 tag |
|
ID3v2(java.io.InputStream in)
Provides access to ID3v2 tag. |
|
| Method Summary | |
void |
addFrame(ID3v2Frame frame)
Add a frame |
java.util.Vector |
getFrame(java.lang.String id)
Return all frame with ID id |
java.util.Vector |
getFrames()
Get all frames |
boolean |
getUseCRC()
|
boolean |
getUsePadding()
|
boolean |
getUseUnsynchronization()
|
boolean |
hasTag()
Test if file already has an ID3v2 tag |
void |
removeFrame(ID3v2Frame frame)
Remove a frame. |
void |
removeFrame(java.lang.String id)
Remove all frames with a given id. |
void |
removeFrame(java.lang.String id,
int number)
Remove a spefic frames with a given id. |
void |
removeFrames()
Remove all frames |
void |
setUseCRC(boolean use_crc)
Enables / disables use of CRC |
void |
setUsePadding(boolean use_padding)
Enables or disables use of padding (enabled by default) |
void |
setUseUnsynchronization(boolean use_unsynch)
Enables / disables use of unsynchronization |
static byte[] |
synchronize(byte[] in)
This method undoes the effect of the unsynchronization scheme by replacing $FF $00 by $FF |
static byte[] |
unsynchronize(byte[] in)
Unsynchronizes an array of bytes by replacing $FF 00 with $FF 00 00 and %11111111 111xxxxx with %11111111 00000000 111xxxxx. |
void |
update()
Write changes to file |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final byte VERSION
public static final byte REVISION
| Constructor Detail |
public ID3v2(java.io.InputStream in)
throws java.io.IOException,
ID3v2IllegalVersionException,
ID3v2WrongCRCException,
ID3v2DecompressionException
update will fail with an
IOException, so make sure you just read.
in - Input stream to read from. Stream position must be set to
beginning of file (i.e. position of ID3v2 tag).
java.io.IOException - If I/O errors occur
ID3v2IllegalVersionException - If file contains an IDv2 tag of higher version than
VERSION.REVISION
ID3v2WrongCRCException - If file contains CRC and this differs from CRC calculated
from the frames
ID3v2DecompressionException - If a decompression error occured while decompressing a
compressed frame
public ID3v2(java.io.File file)
throws java.io.IOException,
ID3v2IllegalVersionException,
ID3v2WrongCRCException,
ID3v2DecompressionException
file's ID3v2 tag
file - File to access
java.io.IOException - If I/O errors occur
ID3v2IllegalVersionException - If file contains an IDv2 tag of higher version than
VERSION.REVISION
ID3v2WrongCRCException - If file contains CRC and this differs from CRC calculated
from the frames
ID3v2DecompressionException - If a decompression error occured while decompressing a
compressed frame| Method Detail |
public static byte[] synchronize(byte[] in)
in - Array of bytes to be "synchronized"
public static byte[] unsynchronize(byte[] in)
in - Array of bytes to be "unsynchronized"
public void setUsePadding(boolean use_padding)
use_padding - True if padding should be usedpublic boolean getUsePadding()
public void setUseCRC(boolean use_crc)
use_crc - True if CRC should be usedpublic boolean getUseCRC()
public void setUseUnsynchronization(boolean use_unsynch)
use_unsynch - True if unsynchronization should be usedpublic boolean getUseUnsynchronization()
public boolean hasTag()
public java.util.Vector getFrames()
throws NoID3v2TagException
Vector of all frames
NoID3v2TagException - If file does not contain ID3v2 tag
public java.util.Vector getFrame(java.lang.String id)
throws NoID3v2TagException,
ID3v2NoSuchFrameException
id
id - Frame ID
NoID3v2TagException - If file does not contain ID3v2Tag
ID3v2NoSuchFrameException - If file does not contain requested ID3v2 framepublic void addFrame(ID3v2Frame frame)
frame - Frame to addpublic void removeFrame(ID3v2Frame frame) throws NoID3v2TagException, ID3v2NoSuchFrameException
frame - Frame to remove
NoID3v2TagException - If file does not contain ID3v2Tag
ID3v2NoSuchFrameException - If file does not contain requested ID3v2 frame
public void removeFrame(java.lang.String id)
throws NoID3v2TagException,
ID3v2NoSuchFrameException
id - ID of frames to remove
NoID3v2TagException - If file does not contain ID3v2Tag
ID3v2NoSuchFrameException - If file does not contain requested ID3v2 frame
public void removeFrame(java.lang.String id,
int number)
throws NoID3v2TagException,
ID3v2NoSuchFrameException
id - ID of frames to removenumber - Number of frame to remove (the first frame gets number 0)
NoID3v2TagException - If file does not contain ID3v2Tag
ID3v2NoSuchFrameException - If file does not contain requested ID3v2 framepublic void removeFrames()
public void update()
throws java.io.IOException
java.io.IOException - If an I/O error occurs or the object was created from an
InputStream and an update should be executed
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||