|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object helliker.id3.ID3v2Frame
Field Summary | |
private boolean |
compressed
|
private int |
dataLength
|
private java.lang.String[] |
ENC_TYPES
|
private byte |
encrType
|
private boolean |
encrypted
|
private boolean |
fileAlterDiscard
|
private int |
FRAME_FLAGS_SIZE
|
private int |
FRAME_HEAD_SIZE
|
private byte[] |
frameData
|
private byte |
group
|
private boolean |
grouped
|
private java.lang.String |
id
|
private boolean |
lengthIndicator
|
private int |
MAX_EXTRA_DATA
|
private boolean |
readOnly
|
private boolean |
tagAlterDiscard
|
private boolean |
unsynchronised
|
Constructor Summary | |
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)
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. |
Method Summary | |
private boolean |
checkDefaultFileAlterDiscard()
Returns true if this frame should have the file alter preservation bit set by default. |
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. |
private java.lang.String |
getDecodedString(byte[] b,
int eIndex,
int offset)
Converts the byte array into a string based on the type of encoding. |
boolean |
getEncrypted()
Returns true if this frame is encrypted |
byte |
getEncryptionType()
If encrypted, this returns the encryption method byte. |
private byte[] |
getExtraDataBytes()
A helper function for the getFrameBytes function that returns an array of all the data contained in any extra fields that may be present in this frame. |
boolean |
getFileAlterDiscard()
Returns true if the file alter preservation bit has been set. |
private byte[] |
getFlagBytes()
A helper function for the getFrameBytes method that processes the info in the frame and returns the 2 byte array of flags to be added to the header. |
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 |
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. |
private void |
parseData(byte[] data)
Pulls out extra information inserted in the frame data depending on what flags are set. |
private void |
parseFlags(byte[] flags)
Read the information from the flags array. |
void |
setFrameData(byte[] newData)
Set the data for this frame. |
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 |
Field Detail |
private final int FRAME_HEAD_SIZE
private final int FRAME_FLAGS_SIZE
private final int MAX_EXTRA_DATA
private final java.lang.String[] ENC_TYPES
private java.lang.String id
private boolean tagAlterDiscard
private boolean fileAlterDiscard
private boolean readOnly
private boolean grouped
private boolean compressed
private boolean encrypted
private boolean unsynchronised
private boolean lengthIndicator
private byte group
private byte encrType
private int dataLength
private byte[] frameData
Constructor Detail |
public ID3v2Frame(java.lang.String id, byte[] flags, byte[] data) throws ID3v2FormatException
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 occurspublic ID3v2Frame(java.lang.String id, byte[] data)
id
- the id of this framedata
- the data for this framepublic ID3v2Frame(java.lang.String id, byte[] data, boolean tagAlterDiscard, boolean fileAlterDiscard, boolean readOnly, boolean grouped, boolean compressed, boolean encrypted, boolean unsynchronised, boolean lengthIndicator)
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 flagMethod Detail |
private boolean checkDefaultFileAlterDiscard()
private void parseFlags(byte[] flags) throws ID3v2FormatException
flags
- the flags found in the frame header
ID3v2FormatException
- if an error occursprivate void parseData(byte[] data)
data
- the frame datapublic byte[] getFrameData()
public void setFrameData(byte[] newData)
newData
- a byte array containing the new datapublic int getFrameLength()
public byte[] getFrameBytes()
private byte[] getFlagBytes()
private byte[] getExtraDataBytes()
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()
private java.lang.String getDecodedString(byte[] b, int eIndex, int offset) throws java.io.UnsupportedEncodingException
b
- the array of bytes to convert/decodeeIndex
- the index in the array where the encoding type residesoffset
- where in the array to start the string
java.io.UnsupportedEncodingException
- if an error occurspublic java.lang.String getDataString() throws ID3v2FormatException
ID3v2FormatException
- if an error occurspublic boolean isEmpty()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |