ReleaseResourceStream
public interface ReleaseResourceStream
Releases a stream that was instantiated by the method associated with the CreateResourceStream interface.
The ReleaseResourceStream interface represents a functional interface that declares a method to release a stream that was previously instantiated by the corresponding method in the CreateResourceStream interface. Implementations of this interface should provide the necessary functionality to release any resources associated with the stream.
Example usage:
ReleaseResourceStream releaseResourceStream = ((pageNumber, resource, resourceStream) -> {
// Custom implementation to release any resources associated with the resource stream
};
HtmlViewOptions htmlViewOptions = HtmlViewOptions.forExternalResources(createPageStream, createResourceStream, releaseResourceStream);
// Use htmlViewOptions in Viewer
Methods
Method | Description |
---|---|
invoke(int pageNumber, Resource resource, OutputStream resourceStream) | Releases the stream created by the method associated with the CreateResourceStream interface. |
invoke(int pageNumber, Resource resource, OutputStream resourceStream)
public abstract void invoke(int pageNumber, Resource resource, OutputStream resourceStream)
Releases the stream created by the method associated with the CreateResourceStream interface.
Parameters:
Parameter | Type | Description |
---|---|---|
pageNumber | int | The number of the page. |
resource | Resource | The resource associated with the stream. |
resourceStream | java.io.OutputStream | The stream to be released. |