com.vaadin.flow.server.

Interface StreamResourceWriter

  • All Superinterfaces:

    Serializable

    Functional Interface:

    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.


    @FunctionalInterface
    public interface StreamResourceWriter
    extends Serializable

    Output stream consumer. Implementation of this interface should write data into OutputStream instance provided as an argument to its accept(OutputStream, VaadinSession) method.

    Since:

    1.0

    Author:

    Vaadin Ltd

    • Method Summary

      All Methods
      Modifier and Type Method and Description
      void accept(OutputStream stream, VaadinSession session)

      Handles stream (writes data to it) using session as a context.

    • Method Detail

      • accept

        void accept(OutputStream stream,
                    VaadinSession session)
             throws IOException

        Handles stream (writes data to it) using session as a context.

        Note that the method is not called under the session lock. It means that if implementation requires access to the application/session data then the session has to be locked explicitly.

        Parameters:

        stream - data output stream

        session - vaadin session

        Throws:

        IOException - if an IO error occurred