|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectentagged.audioformats.ogg.util.OggTagField
public class OggTagField
This class encapsulates the name and content of a tag entry in ogg-files.
| Constructor Summary | |
|---|---|
OggTagField(byte[] raw)
Creates an instance. |
|
OggTagField(String fieldId,
String fieldContent)
Creates an instance. |
|
| Method Summary | |
|---|---|
protected void |
copy(byte[] src,
byte[] dst,
int dstOffset)
This method will copy all bytes of src to dst
at the specified location. |
void |
copyContent(TagField field)
(overridden) |
protected byte[] |
getBytes(String s,
String encoding)
This method will try to return the byte representation of the given string after it has been converted to the given encoding. |
String |
getContent()
(overridden) |
String |
getEncoding()
(overridden) |
String |
getId()
(overridden) |
byte[] |
getRawContent()
(overridden) |
boolean |
isBinary()
(overridden) |
void |
isBinary(boolean b)
(overridden) |
boolean |
isCommon()
(overridden) |
boolean |
isEmpty()
(overridden) |
void |
setContent(String s)
(overridden) |
void |
setEncoding(String s)
(overridden) |
String |
toString()
This method returns a human readable description of the fields contents. For text fields it should be the text itself. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OggTagField(byte[] raw)
throws UnsupportedEncodingException
raw - Raw byte data of the tagfield.
UnsupportedEncodingException - If the data doesn't conform "UTF-8" specification.
public OggTagField(String fieldId,
String fieldContent)
fieldId - ID (name) of the field.fieldContent - Content of the field.| Method Detail |
|---|
protected void copy(byte[] src,
byte[] dst,
int dstOffset)
src to dst
at the specified location.
src - bytes to copy.dst - where to copy to.dstOffset - at which position of dst the data should be
copied.public void copyContent(TagField field)
copyContent in interface TagFieldfield - The field containing the data to be taken.TagField.copyContent(entagged.audioformats.generic.TagField)
protected byte[] getBytes(String s,
String encoding)
throws UnsupportedEncodingException
s - The string whose converted bytes should be returned.encoding - The encoding type to which the string should be converted.
encoding is supported the byte data of the
given string is returned in that encoding.
UnsupportedEncodingException - If the requested encoding is not available.public String getContent()
getContent in interface TagTextFieldTagTextField.getContent()public String getEncoding()
getEncoding in interface TagTextFieldTagTextField.getEncoding()public String getId()
getId in interface TagFieldTagField.getId()
public byte[] getRawContent()
throws UnsupportedEncodingException
getRawContent in interface TagFieldUnsupportedEncodingException - Most tag data represents text. In some cases the underlying
implementation will need to convert the text data in java to
a specific charset encoding. In these cases an
UnsupportedEncodingException may occur.TagField.getRawContent()public boolean isBinary()
isBinary in interface TagFieldtrue if field represents binary data (not human
readable).TagField.isBinary()public void isBinary(boolean b)
isBinary in interface TagFieldb - true, if the field contains binary data.TagField.isBinary(boolean)public boolean isCommon()
isCommon in interface TagFieldtrue if the field is of common use.TagField.isCommon()public boolean isEmpty()
isEmpty in interface TagFieldtrue if no data is stored (or empty String).TagField.isEmpty()public void setContent(String s)
setContent in interface TagTextFields - fields content.TagTextField.setContent(java.lang.String)public void setEncoding(String s)
setEncoding in interface TagTextFields - charset.TagTextField.setEncoding(java.lang.String)public String toString()
TagField
toString in interface TagFieldtoString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||