Class ClassicMp4ContainerSource.TeeInputStream

    • Constructor Detail

      • TeeInputStream

        public TeeInputStream​(InputStream input,
                              OutputStream branch)
        Creates a TeeInputStream that proxies the given InputStream and copies all read bytes to the given OutputStream. The given output stream will not be closed when this stream gets closed.
        Parameters:
        input - input stream to be proxied
        branch - output stream that will receive a copy of all bytes read
    • Method Detail

      • read

        public int read()
                 throws IOException
        Reads a single byte from the proxied input stream and writes it to the associated output stream.
        Overrides:
        read in class FilterInputStream
        Returns:
        next byte from the stream, or -1 if the stream has ended
        Throws:
        IOException - if the stream could not be read (or written)
      • read

        public int read​(byte[] bts,
                        int st,
                        int end)
                 throws IOException
        Reads bytes from the proxied input stream and writes the read bytes to the associated output stream.
        Overrides:
        read in class FilterInputStream
        Parameters:
        bts - byte buffer
        st - start offset within the buffer
        end - maximum number of bytes to read
        Returns:
        number of bytes read, or -1 if the stream has ended
        Throws:
        IOException - if the stream could not be read (or written)
      • read

        public int read​(byte[] bts)
                 throws IOException
        Reads bytes from the proxied input stream and writes the read bytes to the associated output stream.
        Overrides:
        read in class FilterInputStream
        Parameters:
        bts - byte buffer
        Returns:
        number of bytes read, or -1 if the stream has ended
        Throws:
        IOException - if the stream could not be read (or written)