public class Mp4BoxHeader extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CHARSET_UTF_8 |
static int |
DATA_64BITLENGTH |
protected ByteBuffer |
dataBuffer |
static int |
HEADER_LENGTH |
static int |
IDENTIFIER_LENGTH |
static int |
IDENTIFIER_POS |
protected int |
length |
static Logger |
logger |
static int |
OFFSET_LENGTH |
static int |
OFFSET_POS |
static int |
REALDATA_64BITLENGTH |
Constructor and Description |
---|
Mp4BoxHeader()
Construct empty header
Can be populated later with update method
|
Mp4BoxHeader(ByteBuffer headerData)
Construct header
Create header using headerdata, expected to find header at headerdata current position
Note after processing adjusts position to immediately after header
|
Mp4BoxHeader(String id)
Construct header to allow manual creation of header for writing to file
|
Modifier and Type | Method and Description |
---|---|
int |
getDataLength() |
Charset |
getEncoding() |
long |
getFileEndPos() |
long |
getFilePos() |
ByteBuffer |
getHeaderData() |
String |
getId() |
int |
getLength() |
static Mp4BoxHeader |
seekWithinLevel(ByteBuffer data,
String id)
Seek for box with the specified id starting from the current location of filepointer,
Note it won't find the box if it is contained with a level below the current level, nor if we are
at a parent atom that also contains data and we havent yet processed the data.
|
static Mp4BoxHeader |
seekWithinLevel(SeekableByteChannel fc,
String id)
Seek for box with the specified id starting from the current location of filepointer,
Note it wont find the box if it is contained with a level below the current level, nor if we are
at a parent atom that also contains data and we havent yet processed the data.
|
void |
setFilePos(long filePos)
Set location in file of the start of file header (i.e where the 4 byte length field starts)
|
void |
setId(int length)
Set the Id.
|
void |
setLength(int length)
Set the length.
|
String |
toString() |
void |
update(ByteBuffer headerData)
Create header using headerdata, expected to find header at headerdata current position
Note after processing adjusts position to immediately after header
|
public static Logger logger
public static final int OFFSET_POS
public static final int IDENTIFIER_POS
public static final int OFFSET_LENGTH
public static final int IDENTIFIER_LENGTH
public static final int HEADER_LENGTH
public static final int DATA_64BITLENGTH
public static final int REALDATA_64BITLENGTH
protected int length
protected ByteBuffer dataBuffer
public static final String CHARSET_UTF_8
public Mp4BoxHeader()
public Mp4BoxHeader(String id)
id
- public Mp4BoxHeader(ByteBuffer headerData)
headerData
- public void update(ByteBuffer headerData)
headerData
- public String getId()
public int getLength()
public void setLength(int length)
length
- public void setId(int length)
length
- public ByteBuffer getHeaderData()
public int getDataLength()
public Charset getEncoding()
public static Mp4BoxHeader seekWithinLevel(SeekableByteChannel fc, String id) throws IOException
fc
- id
- IOException
public static Mp4BoxHeader seekWithinLevel(ByteBuffer data, String id) throws IOException
data
- id
- IOException
public long getFilePos()
public long getFileEndPos()
public void setFilePos(long filePos)
filePos
- Copyright © 2005–2020 jthink.net. All rights reserved.