|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.vdheide.mp3.ID3v2Frame
This class contains one ID3v2 frame. Note: ID3v2 frame does not now anything about unsynchronization. That is up to higher level objects (i.e. ID3v2)
Field Summary | |
static byte |
DO_COMPRESS
Compression requested |
static java.lang.String |
ID_INVALID
Invalid ID |
static byte |
IS_COMPRESSED
Compression present |
static byte |
NO_COMPRESSION
No compression present or requested |
Constructor Summary | |
ID3v2Frame(java.io.InputStream in)
Creates a new ID3v2 frame from a stream. |
|
ID3v2Frame(java.lang.String id,
byte[] content,
boolean tag_alter_preservation,
boolean file_alter_preservation,
boolean read_only,
byte compression_type,
byte encryption_id,
byte group)
Creates a new ID3v2 frame |
Method Summary | |
boolean |
equals(java.lang.Object other)
Check whether this frame is equal to another frame. |
byte[] |
getBytes()
Returns an array of bytes representing this frame |
boolean |
getCompression()
Determine whether the frame is compressed |
byte[] |
getContent()
Returns content (decompressed) |
byte |
getEncryptionID()
|
boolean |
getFileAlterPreservation()
Determine whether the frame should be preserved if the file but not the frame is altered and the frame ID is unknown to the altering application. |
byte |
getGroup()
Get the group ID this frame belongs to |
java.lang.String |
getID()
Get the ID of this frame. |
int |
getLength()
Calculates the number of bytes necessary to store a byte representation of this frame. |
boolean |
getReadOnly()
Determine whether the frame is read-only |
boolean |
getTagAlterPreservation()
Determine whether the frame should be preserved if the tag is altered and the frame ID is unknown to the altering application. |
void |
setCompression(boolean compression)
Determine whether the frame should be compressed |
void |
setEncryption(byte encryption_id)
Set the encryption ID to use. |
void |
setFileAlterPreservation(boolean file_alter_preservation)
Determine whether the frame should be preserved if the file but not the frame is altered and the frame ID is unknown to the altering application. |
void |
setGroup(byte group)
Set the group ID this frame belongs to |
void |
setID(java.lang.String id)
Set the ID of this frame |
void |
setReadOnly(boolean read_only)
Determine whether the frame is read-only |
void |
setTagAlterPreservation(boolean tag_alter_preservation)
Determine whether the frame should be preserved if the tag is altered and the frame ID is unknown to the altering application. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte NO_COMPRESSION
public static final byte IS_COMPRESSED
public static final byte DO_COMPRESS
public static final java.lang.String ID_INVALID
Constructor Detail |
public ID3v2Frame(java.lang.String id, byte[] content, boolean tag_alter_preservation, boolean file_alter_preservation, boolean read_only, byte compression_type, byte encryption_id, byte group) throws ID3v2DecompressionException
id
- Frame idcontent
- Frame content. Must not be unsynchronized!tag_alter_preservation
- True if frame should be discarded if frame id is unknown to
software and tag is alteredfile_alter_preservation
- Same as tag_alter_preservation
, but applies if
file (excluding tag) is alteredread_only
- True if frame should not be changedcompression_type
- Use contant from this class:
ID3v2Frame.NO_COMPRESSION
:
content
is not compressed and should not be
compressed. ID3v2Frame.IS_COMPRESSED
:
content
is already compressed
ID3v2Frame.DO_COMPRESS
:content
is not compressed, but should be Compression can also be
switched on/off with setCompression
encryption_id
- Encryption method or 0 if not encrypted (not completely
supported, encryption must be done externally)group
- Group of frames this frame belongs to or 0 if frame does not
belong to any group
ID3v2DecompressionException
- If content is compressed and decompresson failspublic ID3v2Frame(java.io.InputStream in) throws java.io.IOException, ID3v2DecompressionException
in
- Stream to read from
ID3v2DecompressionException
- If input is compressed and decompression fails
java.io.IOException
- If I/O error occursMethod Detail |
public java.lang.String getID()
public void setID(java.lang.String id)
id
- ID to setpublic boolean getTagAlterPreservation()
public void setTagAlterPreservation(boolean tag_alter_preservation)
tag_alter_preservation
- true if the frame should be preservedpublic boolean getFileAlterPreservation()
public void setFileAlterPreservation(boolean file_alter_preservation)
file_alter_preservation
- true if the frame should be preservedpublic boolean getReadOnly()
public void setReadOnly(boolean read_only)
read_only
- true if the frame is read-onlypublic boolean getCompression()
public void setCompression(boolean compression)
compression
- true if the frame should be compressedpublic byte getEncryptionID()
public void setEncryption(byte encryption_id)
encryption_id
- encryption ID to use or 0 for no encryptionpublic byte getGroup()
public void setGroup(byte group)
group
- group ID or 0 if no grouppublic int getLength()
public byte[] getContent()
public byte[] getBytes()
public boolean equals(java.lang.Object other)
other
- the other frame
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |