org.jaudiotagger.tag.mp4.field
Class Mp4TagByteField
java.lang.Object
org.jaudiotagger.tag.mp4.Mp4TagField
org.jaudiotagger.tag.mp4.field.Mp4TagTextField
org.jaudiotagger.tag.mp4.field.Mp4TagByteField
- All Implemented Interfaces:
- TagField, TagTextField
public class Mp4TagByteField
- extends Mp4TagTextField
Represents a single byte as a number
Usually single byte fields are used as a boolean field, but not always so we dont do this conversion
Constructor Summary |
Mp4TagByteField(Mp4FieldKey id,
java.lang.String value)
Create new field
Assume length of 1 which is correct for most but not all byte fields |
Mp4TagByteField(Mp4FieldKey id,
java.lang.String value,
int realDataLength)
Create new field with known length |
Mp4TagByteField(java.lang.String id,
java.nio.ByteBuffer raw)
Construct from rawdata from audio file |
Method Summary |
protected void |
build(java.nio.ByteBuffer data)
Processes the data and sets the position of the data buffer to just after the end of this fields data
ready for processing next field. |
protected byte[] |
getDataBytes()
Return raw data bytes
TODO this code should be done better so generalised to any length |
Mp4FieldType |
getFieldType()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
TRUE_VALUE
public static java.lang.String TRUE_VALUE
realDataLength
private int realDataLength
bytedata
private byte[] bytedata
Mp4TagByteField
public Mp4TagByteField(Mp4FieldKey id,
java.lang.String value)
throws FieldDataInvalidException
- Create new field
Assume length of 1 which is correct for most but not all byte fields
- Parameters:
id
- value
- is a String representation of a number
- Throws:
FieldDataInvalidException
Mp4TagByteField
public Mp4TagByteField(Mp4FieldKey id,
java.lang.String value,
int realDataLength)
throws FieldDataInvalidException
- Create new field with known length
- Parameters:
id
- value
- is a String representation of a numberrealDataLength
-
- Throws:
FieldDataInvalidException
Mp4TagByteField
public Mp4TagByteField(java.lang.String id,
java.nio.ByteBuffer raw)
throws java.io.UnsupportedEncodingException
- Construct from rawdata from audio file
- Parameters:
id
- raw
-
- Throws:
java.io.UnsupportedEncodingException
getFieldType
public Mp4FieldType getFieldType()
- Overrides:
getFieldType
in class Mp4TagTextField
- Returns:
- the field type of this field
getDataBytes
protected byte[] getDataBytes()
throws java.io.UnsupportedEncodingException
- Return raw data bytes
TODO this code should be done better so generalised to any length
- Overrides:
getDataBytes
in class Mp4TagTextField
- Returns:
-
- Throws:
java.io.UnsupportedEncodingException
build
protected void build(java.nio.ByteBuffer data)
throws java.io.UnsupportedEncodingException
- Description copied from class:
Mp4TagField
- Processes the data and sets the position of the data buffer to just after the end of this fields data
ready for processing next field.
- Overrides:
build
in class Mp4TagTextField
- Throws:
java.io.UnsupportedEncodingException