AbstractStringpublic abstract class AbstractString extends AbstractDataType A partial implementation for String based ID3 fields |
Methods Summary |
---|
public boolean | canBeEncoded()Check the value can be encoded with the specified encoding
//Try and write to buffer using the CharSet defined by the textEncoding field (note if using UTF16 we dont
//need to worry about LE,BE at this point it makes no difference)
byte textEncoding = this.getBody().getTextEncoding();
String charSetName = TextEncoding.getInstanceOf().getValueForId(textEncoding);
CharsetEncoder encoder = Charset.forName(charSetName).newEncoder();
if (encoder.canEncode((String) value))
{
return true;
}
else
{
logger.finest("Failed Trying to decode" + value + "with" + encoder.toString());
return false;
}
| public int | getSize()Return the size in bytes of this datatype as it was/is held in file this
will be effected by the encoding type.
return size;
| protected void | setSize(int size)Sets the size in bytes of this data type.
This is set after writing the data to allow us to recalculate the size for
frame header.
this.size = size;
| public java.lang.String | toString()Return String representation of data type
return (String) value;
|
|