public class Mp4BoxHeader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CHARSET_UTF_8 |
protected java.nio.ByteBuffer |
dataBuffer |
private long |
filePos |
static int |
HEADER_LENGTH |
private java.lang.String |
id |
static int |
IDENTIFIER_LENGTH |
static int |
IDENTIFIER_POS |
protected int |
length |
static java.util.logging.Logger |
logger |
static int |
OFFSET_LENGTH |
static int |
OFFSET_POS |
Constructor and Description |
---|
Mp4BoxHeader()
Construct empty header
Can be populated later with update method
|
Mp4BoxHeader(java.nio.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(java.lang.String id)
Construct header to allow manual creation of header for writing to file
|
Modifier and Type | Method and Description |
---|---|
int |
getDataLength() |
java.lang.String |
getEncoding() |
long |
getFilePos() |
java.nio.ByteBuffer |
getHeaderData() |
java.lang.String |
getId() |
int |
getLength() |
static Mp4BoxHeader |
seekWithinLevel(java.nio.ByteBuffer data,
java.lang.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(java.io.RandomAccessFile raf,
java.lang.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.
|
java.lang.String |
toString() |
void |
update(java.nio.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 java.util.logging.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
private java.lang.String id
protected int length
private long filePos
protected java.nio.ByteBuffer dataBuffer
public static final java.lang.String CHARSET_UTF_8
public Mp4BoxHeader()
public Mp4BoxHeader(java.lang.String id)
id
- public Mp4BoxHeader(java.nio.ByteBuffer headerData)
headerData
- public void update(java.nio.ByteBuffer headerData)
headerData
- public java.lang.String getId()
public int getLength()
public void setLength(int length)
length
- public void setId(int length)
length
- public java.nio.ByteBuffer getHeaderData()
public int getDataLength()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getEncoding()
public static Mp4BoxHeader seekWithinLevel(java.io.RandomAccessFile raf, java.lang.String id) throws java.io.IOException
raf
- id
- java.io.IOException
public static Mp4BoxHeader seekWithinLevel(java.nio.ByteBuffer data, java.lang.String id) throws java.io.IOException
data
- id
- java.io.IOException
public long getFilePos()
public void setFilePos(long filePos)
filePos
- Copyright © 2005-2013 java.net. All Rights Reserved.