1
package org.jaudiotagger.tag.mp4.atom;
3
import org.jaudiotagger.audio.mp4.atom.Mp4BoxHeader;
4
import org.jaudiotagger.audio.mp4.atom.AbstractMp4Box;
5
import org.jaudiotagger.audio.generic.Utils;
7
import java.nio.ByteBuffer;
10
* This box is used within ---- boxes to hold the data name/descriptor
12
public class Mp4NameBox extends AbstractMp4Box
14
public static final String IDENTIFIER = "name";
18
//TODO Are these misnamed, are these version flag bytes or just null bytes
19
public static final int VERSION_LENGTH = 1;
20
public static final int FLAGS_LENGTH = 3;
21
public static final int PRE_DATA_LENGTH = VERSION_LENGTH + FLAGS_LENGTH;
25
* @param header header info
26
* @param dataBuffer data of box (doesnt include header data)
28
public Mp4NameBox(Mp4BoxHeader header, ByteBuffer dataBuffer)
33
if(!header.getId().equals(IDENTIFIER))
35
throw new RuntimeException("Unable to process data box because identifier is:"+header.getId());
38
//Make slice so operations here don't effect position of main buffer
39
this.dataBuffer = dataBuffer.slice();
42
this.name= Utils.getString(this.dataBuffer, PRE_DATA_LENGTH, header.getDataLength() - PRE_DATA_LENGTH, header.getEncoding());
45
public String getName()