|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpgbennett.id3.ID3v2Frame
public class ID3v2Frame
This class holds the information found in an id3v2 frame. At this point at
least, the information in the tag header is read-only and can only be set set
in the constructor. This is for simplicity's sake. This object doesn't
automatically unsynchronise, encrypt, or compress the data.
| Constructor Summary | |
|---|---|
ID3v2Frame(ID3v2Picture pic)
Create and ID3v2 frame with the specified id and data. |
|
ID3v2Frame(java.lang.String id,
byte[] data)
Create and ID3v2 frame with the specified id and data. |
|
ID3v2Frame(java.lang.String id,
byte[] data,
boolean tagAlterDiscard,
boolean fileAlterDiscard,
boolean readOnly,
boolean grouped,
boolean compressed,
boolean encrypted,
boolean unsynchronised,
boolean lengthIndicator)
Create an ID3v2Frame with the specified id, data, and flags set. |
|
ID3v2Frame(java.lang.String id,
byte[] flags,
byte[] data,
int majorVersion)
Create an ID3v2Frame with a specified id, a byte array containing the frame header flags, and a byte array containing the data for this frame. |
|
ID3v2Frame(java.lang.String id,
java.lang.String lang,
java.lang.String desc,
java.lang.String data)
|
|
| Method Summary | |
|---|---|
static byte[] |
encodeString(java.lang.String source,
byte[] encodingB)
|
boolean |
getCompressed()
Returns true if this frame is compressed |
int |
getDataLength()
If a length indicator has been added, the length of the data is returned. |
java.lang.String |
getDataString()
If possible, this method attempts to convert textual part of the data into a string. |
boolean |
getEncrypted()
Returns true if this frame is encrypted |
byte |
getEncryptionType()
If encrypted, this returns the encryption method byte. |
java.lang.String |
getExtendedId()
Get extended id for cases where two occurrences of the same id are allowed with different descriptors (e.g. |
boolean |
getFileAlterDiscard()
Returns true if the file alter preservation bit has been set. |
byte[] |
getFrameBytes()
Returns a byte array representation of this frame that can be written to a file. |
byte[] |
getFrameData()
Returns the data for this frame |
int |
getFrameLength()
Return the length of this frame in bytes, including the header. |
byte |
getGroup()
Returns the group identifier if added. |
boolean |
getGrouped()
Returns true if this frame is a part of a group |
boolean |
getLengthIndicator()
Returns true if this frame has a length indicator added |
ID3v2Picture |
getPicture()
Get Picture data for APIC frame |
boolean |
getReadOnly()
Returns true if this frame is read only |
boolean |
getTagAlterDiscard()
Returns true if the tag alter preservation bit has been set. |
boolean |
getUnsynchronised()
Returns true if this frame is unsynchronised |
boolean |
isEmpty()
Returns true if there is no data in the frame. |
void |
setFrameData(byte[] newData)
Set the data for this frame. |
void |
setPicture(ID3v2Picture pic)
|
java.lang.String |
toString()
Return a string representation of this object that contains all the information contained within it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ID3v2Frame(java.lang.String id,
byte[] flags,
byte[] data,
int majorVersion)
throws ID3v2FormatException,
java.io.UnsupportedEncodingException
id - the id of this frameflags - the flags found in the header of the frame
(2 bytes)data - the data found in this frame
ID3v2FormatException - if an error occurs
java.io.UnsupportedEncodingException
public ID3v2Frame(java.lang.String id,
byte[] data)
throws java.io.UnsupportedEncodingException
id - the id of this framedata - the data for this frame
java.io.UnsupportedEncodingException
public ID3v2Frame(ID3v2Picture pic)
throws java.io.UnsupportedEncodingException
id - the id of this framedata - the data for this frame
java.io.UnsupportedEncodingException
public ID3v2Frame(java.lang.String id,
java.lang.String lang,
java.lang.String desc,
java.lang.String data)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingException
public ID3v2Frame(java.lang.String id,
byte[] data,
boolean tagAlterDiscard,
boolean fileAlterDiscard,
boolean readOnly,
boolean grouped,
boolean compressed,
boolean encrypted,
boolean unsynchronised,
boolean lengthIndicator)
throws java.io.UnsupportedEncodingException
id - the id for this framedata - the data for this frametagAlterDiscard - the tag alter preservation flagfileAlterDiscard - the file alter preservation flagreadOnly - the read only flaggrouped - the grouping identity flagcompressed - the compression flagencrypted - the encryption flagunsynchronised - the unsynchronisation flaglengthIndicator - the data length indicator flag
java.io.UnsupportedEncodingException| Method Detail |
|---|
public static byte[] encodeString(java.lang.String source,
byte[] encodingB)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic void setFrameData(byte[] newData)
newData - a byte array containing the new datapublic byte[] getFrameData()
public int getFrameLength()
public byte[] getFrameBytes()
public boolean getTagAlterDiscard()
public boolean getFileAlterDiscard()
public boolean getReadOnly()
public boolean getGrouped()
public boolean getCompressed()
public boolean getEncrypted()
public boolean getUnsynchronised()
public boolean getLengthIndicator()
public byte getGroup()
public byte getEncryptionType()
public int getDataLength()
public java.lang.String getDataString()
throws ID3v2FormatException
ID3v2FormatException - if an error occurspublic boolean isEmpty()
public java.lang.String toString()
toString in class java.lang.Objectpublic ID3v2Picture getPicture()
public void setPicture(ID3v2Picture pic)
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic java.lang.String getExtendedId()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||