Class ImmutableTag

java.lang.Object
org.red5.server.stream.consumer.ImmutableTag
All Implemented Interfaces:
IoConstants, ITag

public class ImmutableTag extends Object implements ITag
An ImmutableTag represents immutable encapsulation of flash media data. The timestamp is the only mutable field.
Author:
Paul Gregoire (mondain@gmail.com)
  • Field Details

    • dataType

      private final byte dataType
      Tag data type
    • timestamp

      private int timestamp
      Timestamp
    • body

      private final byte[] body
      Tag body as byte buffer
    • previousTagSize

      private final int previousTagSize
      Previous tag size
  • Constructor Details

    • ImmutableTag

      private ImmutableTag(byte dataType, int timestamp, byte[] data)
      ImmutableTag Constructor
      Parameters:
      dataType - Tag data type
      timestamp - Timestamp
      body - Tag body
    • ImmutableTag

      private ImmutableTag(byte dataType, int timestamp, byte[] data, int previousTagSize)
      ImmutableTag Constructor
      Parameters:
      dataType - Tag data type
      timestamp - Timestamp
      body - Tag body
      previousTagSize - Previous tag size information
  • Method Details

    • getDataType

      public byte getDataType()
      Get the data type
      Specified by:
      getDataType in interface ITag
      Returns:
      Tag data type
    • getTimestamp

      public int getTimestamp()
      Return the timestamp
      Specified by:
      getTimestamp in interface ITag
      Returns:
      Tag timestamp
    • setTimestamp

      public void setTimestamp(int timestamp)
      Description copied from interface: ITag
      Set the timestamp.
      Specified by:
      setTimestamp in interface ITag
      Parameters:
      timestamp - Timestamp
    • getData

      public org.apache.mina.core.buffer.IoBuffer getData()
      Returns the data as a ByteBuffer
      Specified by:
      getData in interface ITag
      Returns:
      ByteBuffer Data as byte buffer
    • getBody

      public org.apache.mina.core.buffer.IoBuffer getBody()
      Return the body IoBuffer
      Specified by:
      getBody in interface ITag
      Returns:
      Tag body
    • getBodySize

      public int getBodySize()
      Return the size of the body
      Specified by:
      getBodySize in interface ITag
      Returns:
      Tag body size
    • getPreviousTagSize

      public int getPreviousTagSize()
      Return previous tag size
      Specified by:
      getPreviousTagSize in interface ITag
      Returns:
      Previous tag size
    • setBody

      public void setBody(org.apache.mina.core.buffer.IoBuffer body)
      Description copied from interface: ITag
      Set the body ByteBuffer.
      Specified by:
      setBody in interface ITag
      Parameters:
      body - Body as ByteBuffer
    • setBodySize

      public void setBodySize(int size)
      Description copied from interface: ITag
      Set the size of the body.
      Specified by:
      setBodySize in interface ITag
      Parameters:
      size - Body size
    • setDataType

      public void setDataType(byte datatype)
      Description copied from interface: ITag
      Set the data type.
      Specified by:
      setDataType in interface ITag
      Parameters:
      datatype - Data type
    • setPreviousTagSize

      public void setPreviousTagSize(int size)
      Description copied from interface: ITag
      Set the size of the previous tag.
      Specified by:
      setPreviousTagSize in interface ITag
      Parameters:
      size - Previous tag size
    • toString

      public String toString()
      Prints out the contents of the tag
      Overrides:
      toString in class Object
      Returns:
      Tag contents
    • build

      public static ImmutableTag build(byte dataType, int timestamp)
    • build

      public static ImmutableTag build(byte dataType, int timestamp, Object data)
    • build

      public static ImmutableTag build(byte dataType, int timestamp, org.apache.mina.core.buffer.IoBuffer data)
    • build

      public static ImmutableTag build(byte dataType, int timestamp, byte[] data, int previousTagSize)
    • build

      public static ImmutableTag build(byte dataType, int timestamp, org.apache.mina.core.buffer.IoBuffer data, int previousTagSize)