org.springframework.core.io

Interface InputStreamSource

    • Method Detail

      • getInputStream

        InputStream getInputStream()
                                   throws IOException
        Return an InputStream.

        It is expected that each call creates a fresh stream.

        This requirement is particularly important when you consider an API such as JavaMail, which needs to be able to read the stream multiple times when creating mail attachments. For such a use case, it is required that each getInputStream() call returns a fresh stream.

        Returns:
        the input stream for the underlying resource (must not be null)
        Throws:
        IOException - if the stream could not be opened
        See Also:
        org.springframework.mail.javamail.MimeMessageHelper#addAttachment(String, InputStreamSource)