Class AdtsStreamReader


  • public class AdtsStreamReader
    extends java.lang.Object
    Finds and reads ADTS packet headers from an input stream.
    • Constructor Summary

      Constructors 
      Constructor Description
      AdtsStreamReader​(java.io.InputStream inputStream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AdtsPacketHeader findPacketHeader()
      Scan the input stream for an ADTS packet header.
      AdtsPacketHeader findPacketHeader​(int maximumDistance)
      Scan the input stream for an ADTS packet header.
      void nextPacket()
      Resets the current packet, makes next calls to findPacketHeader scan for the next occurrence in the stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AdtsStreamReader

        public AdtsStreamReader​(java.io.InputStream inputStream)
        Parameters:
        inputStream - The input stream to use.
    • Method Detail

      • findPacketHeader

        public AdtsPacketHeader findPacketHeader()
                                          throws java.io.IOException
        Scan the input stream for an ADTS packet header. Subsequent calls will return the same header until nextPacket() is called.
        Returns:
        The packet header if found before EOF.
        Throws:
        java.io.IOException - On read error.
      • findPacketHeader

        public AdtsPacketHeader findPacketHeader​(int maximumDistance)
                                          throws java.io.IOException
        Scan the input stream for an ADTS packet header. Subsequent calls will return the same header until nextPacket() is called.
        Parameters:
        maximumDistance - Maximum number of bytes to scan.
        Returns:
        The packet header if found before EOF and maximum byte limit.
        Throws:
        java.io.IOException - On read error.
      • nextPacket

        public void nextPacket()
        Resets the current packet, makes next calls to findPacketHeader scan for the next occurrence in the stream.