Interface ModuleContentProvider

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void finalizeStream​(java.io.OutputStream destination)
      Finalizes a module library.
      java.io.OutputStream prepareStream​(java.io.OutputStream destination)
      Prepares a destination stream for library contents.
      void writeContent​(java.io.OutputStream destination)
      Sends all library content to provided output stream.
    • Method Detail

      • prepareStream

        java.io.OutputStream prepareStream​(java.io.OutputStream destination)
                                    throws java.io.IOException
        Prepares a destination stream for library contents.

        Whatever logic is implemented in scope of this method, a returned stream should not prevent from writing content into provided stream.

        Parameters:
        destination - destination stream compatible with library handler
        Returns:
        actual destination stream to be used by library handler
        Throws:
        java.io.IOException - whenever there is a problem with initializing library destination stream
      • writeContent

        void writeContent​(java.io.OutputStream destination)
                   throws java.io.IOException
        Sends all library content to provided output stream.
        Parameters:
        destination - library output stream
        Throws:
        java.io.IOException - whenever there is a problem with providing library contents
      • finalizeStream

        void finalizeStream​(java.io.OutputStream destination)
                     throws java.io.IOException
        Finalizes a module library.

        Method is called once per module library just before a stream is closed.

        Parameters:
        destination - module library stream
        Throws:
        java.io.IOException - whenever there is a problem with finalizing library destination stream