CreateResourceStream
public interface CreateResourceStream
Represents an interface that instantiates a stream used to write output HTML resource data.
The CreateResourceStream interface is a functional interface that provides a method for creating a stream to write the output HTML resource data. It can be implemented by custom classes to define the behavior of generating and writing HTML resource data to a stream.
Example usage:
CreateResourceStream createResourceStream = (pageNumber, resource)
-> new FileOutputStream("file-" + pageNumber + "-" + resource.getFileName());
HtmlViewOptions.forExternalResources(pageStreamFactory, createResourceStream);
Methods
Method | Description |
---|---|
invoke(int pageNumber, Resource resource) | Returns an OutputStream that will be used to write output HTML resource data. |
invoke(int pageNumber, Resource resource)
public abstract OutputStream invoke(int pageNumber, Resource resource)
Returns an OutputStream that will be used to write output HTML resource data.
Parameters:
Parameter | Type | Description |
---|---|---|
pageNumber | int | Number of the page. |
resource | Resource | HTML resource such as font, style, image, or graphics. |
Returns: java.io.OutputStream - the stream used to write output HTML resource data.