Package org.red5.io.matroska.dtd
Class BinaryTag
- java.lang.Object
-
- org.red5.io.matroska.dtd.Tag
-
- org.red5.io.matroska.dtd.BinaryTag
-
public class BinaryTag extends Tag
http://matroska.org/technical/specs/index.html webm tag to hold "binary" value as byte[] array
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringbytesToHex(byte[] bytes)Utility helper method to get string representation of given byte arraybyte[]getValue()getter for valuevoidparse(InputStream inputStream)method to read and to parse tag from inputStream givenprotected voidputValue(ByteBuffer bb)method to store tag value toByteBuffergivenBinaryTagsetValue(byte[] value)setter for value, updates the size of this tagStringtoString()method to get "pretty" representedTag
-
-
-
Constructor Detail
-
BinaryTag
public BinaryTag(String name, VINT id) throws IOException
Constructor- Parameters:
name- - the name of tag to be createdid- - the id of tag to be created- Throws:
IOException- - in case of IO error- See Also:
Tag(String, VINT)
-
BinaryTag
public BinaryTag(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 IO error- See Also:
Tag(String, VINT, VINT, InputStream)
-
-
Method Detail
-
parse
public void parse(InputStream inputStream) throws IOException
Description copied from class:Tagmethod to read and to parse tag from inputStream given- Specified by:
parsein classTag- Parameters:
inputStream- - stream to parse tag data from- Throws:
IOException- - in case of any IO errors- See Also:
Tag.parse(InputStream)
-
putValue
protected void putValue(ByteBuffer bb) throws IOException
Description copied from class:Tagmethod to store tag value toByteBuffergiven- Specified by:
putValuein classTag- Parameters:
bb- -ByteBufferto store value- Throws:
IOException- - in case of any IO errors- See Also:
Tag.putValue(ByteBuffer)
-
getValue
public byte[] getValue()
getter for value- Returns:
- - byte array stored by this binary tag
-
setValue
public BinaryTag setValue(byte[] value)
setter for value, updates the size of this tag- Parameters:
value- - value to be set- Returns:
- - this for chaining
-
bytesToHex
public static String bytesToHex(byte[] bytes)
Utility helper method to get string representation of given byte array- Parameters:
bytes- - bytes to be printed- Returns:
- - String representation of byte array
-
-