public class Mp4TagByteField extends Mp4TagTextField
Usually single byte fields are used as a boolean field, but not always so we dont do this conversion
Modifier and Type | Field and Description |
---|---|
private byte[] |
bytedata |
static java.lang.String |
FALSE_VALUE |
private int |
realDataLength |
static java.lang.String |
TRUE_VALUE |
content, dataSize
id, logger, parentHeader
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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() |
copyContent, getContent, getEncoding, isBinary, isEmpty, setContent, setEncoding, toString
getId, getIdBytes, getRawContent, getRawContentDataOnly, isBinary, isCommon
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getRawContent, isBinary, isCommon
public static java.lang.String TRUE_VALUE
public static java.lang.String FALSE_VALUE
private int realDataLength
private byte[] bytedata
public Mp4TagByteField(Mp4FieldKey id, java.lang.String value) throws FieldDataInvalidException
id
- value
- is a String representation of a numberFieldDataInvalidException
public Mp4TagByteField(Mp4FieldKey id, java.lang.String value, int realDataLength) throws FieldDataInvalidException
id
- value
- is a String representation of a numberrealDataLength
- FieldDataInvalidException
public Mp4TagByteField(java.lang.String id, java.nio.ByteBuffer raw) throws java.io.UnsupportedEncodingException
id
- raw
- java.io.UnsupportedEncodingException
public Mp4FieldType getFieldType()
getFieldType
in class Mp4TagTextField
protected byte[] getDataBytes() throws java.io.UnsupportedEncodingException
getDataBytes
in class Mp4TagTextField
java.io.UnsupportedEncodingException
protected void build(java.nio.ByteBuffer data) throws java.io.UnsupportedEncodingException
Mp4TagField
build
in class Mp4TagTextField
java.io.UnsupportedEncodingException
Copyright © 2005-2013 java.net. All Rights Reserved.