Top Description Fields Constructors Methods
org.springframework.aot.generate

pack-priv Class AppendableConsumerInputStreamSource

extends Object
implements InputStreamSource
Class Inheritance
All Implemented Interfaces
org.springframework.core.io.InputStreamSource
Imports
java.io.ByteArrayInputStream, .InputStream, java.nio.charset.StandardCharsets, org.springframework.core.io.InputStreamSource, org.springframework.util.function.ThrowingConsumer

Adapter class to convert a ThrowingConsumer of Appendable to an InputStreamSource.
Author
Phillip Webb
Since
6.0

Field Summary

Modifier and TypeField and Description
private final ThrowingConsumer<Appendable>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public InputStream
getInputStream()

Implements org.springframework.core.io.InputStreamSource.getInputStream.

Return an InputStream for the content of an underlying resource.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

contentback to summary
private final ThrowingConsumer<Appendable> content

Constructor Detail

AppendableConsumerInputStreamSourceback to summary
pack-priv AppendableConsumerInputStreamSource(ThrowingConsumer<Appendable> content)

Method Detail

getInputStreamback to summary
public InputStream getInputStream()

Implements org.springframework.core.io.InputStreamSource.getInputStream.

Doc from org.springframework.core.io.InputStreamSource.getInputStream.

Return an InputStream for the content of an underlying resource.

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:InputStream

the input stream for the underlying resource (must not be null)

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override