public class Mp4TagTextField extends Mp4TagField implements TagTextField
Mp4 metadata normally held as follows:
MP4Box Parent contains :length (includes length of data child) (4 bytes) :name (4 bytes) :child with :length (4 bytes) :name 'Data' (4 bytes) :atom version (1 byte) :atom type flags (3 bytes) :null field (4 bytes) :data
Note:This class is initialized with the child data atom only, the parent data has already been processed, this may change as it seems that code should probably be enscapulated into this. Whereas the raw content returned by the getRawContent() contains the byte data for parent and child.
Modifier and Type | Field and Description |
---|---|
protected String |
content |
protected int |
dataSize |
id, logger, parentHeader
Constructor and Description |
---|
Mp4TagTextField(String id,
ByteBuffer data)
Construct from File
|
Mp4TagTextField(String id,
String content)
Construct new Field
|
Modifier and Type | Method and Description |
---|---|
protected void |
build(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.
|
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.
|
protected byte[] |
getDataBytes() |
Charset |
getEncoding()
Returns the current used charset encoding.
|
Mp4FieldType |
getFieldType() |
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 . |
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. |
getId, getIdBytes, getRawContent, getRawContentDataOnly, isBinary, isCommon
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getRawContent, isBinary, isCommon
protected int dataSize
protected String content
public Mp4TagTextField(String id, ByteBuffer data) throws UnsupportedEncodingException
id
- parent iddata
- atom dataUnsupportedEncodingException
protected void build(ByteBuffer data) throws UnsupportedEncodingException
Mp4TagField
build
in class Mp4TagField
UnsupportedEncodingException
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
protected byte[] getDataBytes() throws UnsupportedEncodingException
getDataBytes
in class Mp4TagField
UnsupportedEncodingException
public Mp4FieldType getFieldType()
getFieldType
in class Mp4TagField
public Charset getEncoding()
TagTextField
getEncoding
in interface TagTextField
public boolean isBinary()
TagField
false
.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.