public class ID3v1TagField extends Object implements TagTextField
Constructor and Description |
---|
ID3v1TagField(byte[] raw)
Creates an instance.
|
ID3v1TagField(String fieldId,
String fieldContent)
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
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)
This method copies the data of the given field to the current data.
|
String |
getContent()
Returns the content of the field.
|
Charset |
getEncoding()
Returns the current used charset encoding.
|
String |
getId()
Returns the Id of the represented tag field.
This value should uniquely identify a kind of tag data, like title. |
byte[] |
getRawContent()
This method delivers the binary representation of the fields data in
order to be directly written to the file.
|
boolean |
isBinary()
Determines whether the represented field contains (is made up of) binary
data, instead of text data.
Software can identify fields to be displayed because they are human readable if this method returns false . |
void |
isBinary(boolean b)
This method will set the field to represent binary data.
Some implementations may support conversions. As of now (Octobre 2005) there is no implementation really using this method to perform useful operations. |
boolean |
isCommon()
Identifies a field to be of common use.
Some software may differ between common and not common fields. |
boolean |
isEmpty()
Determines whether the content of the field is empty.
|
void |
setContent(String s)
Sets the content of the field.
|
void |
setEncoding(Charset s)
Sets the charset encoding used by the field.
|
String |
toString()
This method returns a human readable description of the fields contents.
For text fields it should be the text itself. |
public ID3v1TagField(byte[] raw) throws UnsupportedEncodingException
raw
- Raw byte data of the tagfield.UnsupportedEncodingException
- If the data doesn't conform "UTF-8" specification.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)
TagField
copyContent
in interface TagField
field
- The field containing the data to be taken.public String getContent()
TagTextField
getContent
in interface TagTextField
public Charset getEncoding()
TagTextField
getEncoding
in interface TagTextField
public String getId()
TagField
AbstractTag
will use the "id" to summarize multiple
fields.public byte[] getRawContent() throws UnsupportedEncodingException
TagField
getRawContent
in interface TagField
UnsupportedEncodingException
- 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.public boolean isBinary()
TagField
false
.public void isBinary(boolean b)
TagField
public boolean isCommon()
TagField
public boolean isEmpty()
TagField
public void setContent(String s)
TagTextField
setContent
in interface TagTextField
s
- fields content.public void setEncoding(Charset s)
TagTextField
setEncoding
in interface TagTextField
s
- charset.public String toString()
TagField
Copyright © 2005–2020 jthink.net. All rights reserved.