Package org.red5.io.matroska.dtd
Class Tag
- java.lang.Object
-
- org.red5.io.matroska.dtd.Tag
-
- Direct Known Subclasses:
BinaryTag,CompoundTag,FloatTag,SimpleBlock,StringTag,UnsignedIntegerTag
public abstract class Tag extends Object
Base class for all webm tags
-
-
Constructor Summary
Constructors Constructor Description Tag(String name, VINT id)Constructor, internally callsTag(String, VINT, VINT, InputStream)to create tag with 0 sizeTag(String name, VINT id, VINT size, InputStream inputStream)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]encode()method to encodeTagas sequence of byteslonggetId()getter for idStringgetName()getter for namelonggetSize()getter for sizevoidparse()method to parse tag from inner bytes array - dataabstract voidparse(InputStream inputStream)method to read and to parse tag from inputStream givenprotected abstract voidputValue(ByteBuffer bb)method to store tag value toByteBuffergivenvoidreadData(InputStream inputStream)method to read tag data from inputStream givenStringtoString()method to get "pretty" representedTaginttotalSize()method to get total size of this tag: "header" + "contents"
-
-
-
Constructor Detail
-
Tag
public Tag(String name, VINT id) throws IOException
Constructor, internally callsTag(String, VINT, VINT, InputStream)to create tag with 0 size- Parameters:
name- - the name of tag to be createdid- - the id of tag to be created- Throws:
IOException- - in case of IO error
-
Tag
public Tag(String name, VINT id, VINT size, InputStream inputStream) throws IOException
Constructor- Parameters:
name- - the name of tag to be createdid- - the id of tag to be createdsize- - the size of tag to be createdinputStream- - stream to read tag data from- Throws:
IOException- - in case of any IO errors
-
-
Method Detail
-
parse
public abstract void parse(InputStream inputStream) throws IOException, ConverterException
method to read and to parse tag from inputStream given- Parameters:
inputStream- - stream to parse tag data from- Throws:
IOException- - in case of any IO errorsConverterException- - in case of any conversion errors
-
parse
public void parse() throws IOException, ConverterExceptionmethod to parse tag from inner bytes array - data- Throws:
IOException- - in case of any IO errorsConverterException- - in case of any conversion errors
-
readData
public void readData(InputStream inputStream) throws IOException
method to read tag data from inputStream given- Parameters:
inputStream- InputStream- Throws:
IOException- - in case of any IO errors
-
putValue
protected abstract void putValue(ByteBuffer bb) throws IOException
method to store tag value toByteBuffergiven- Parameters:
bb- -ByteBufferto store value- Throws:
IOException- - in case of any IO errors
-
getId
public long getId()
getter for id
-
getSize
public long getSize()
getter for size
-
totalSize
public int totalSize()
method to get total size of this tag: "header" + "contents"- Returns:
- - total size as int
-
encode
public byte[] encode() throws IOExceptionmethod to encodeTagas sequence of bytes- Returns:
- - encoded
Tag - Throws:
IOException- - in case of any IO errors
-
-