Package dev.langchain4j.image_to_diagram
Class ImageLoader
java.lang.Object
dev.langchain4j.image_to_diagram.ImageLoader
The `ImageLoader` class provides utility methods for loading and converting images to Base64 format.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
loadImageAsBase64
(InputStream inputStream) Loads an image from an input stream and returns its Base64 encoded string representation.static String
loadImageAsBase64
(String resourcePath) Loads an image from a resource path as a Base64 encoded string.
-
Constructor Details
-
ImageLoader
public ImageLoader()
-
-
Method Details
-
loadImageAsBase64
Loads an image from a resource path as a Base64 encoded string.- Parameters:
resourcePath
- the path of the image resource- Returns:
- the Base64 encoded string representing the image
- Throws:
IOException
- if an I/O error occurs while reading the input stream
-
loadImageAsBase64
Loads an image from an input stream and returns its Base64 encoded string representation.- Parameters:
inputStream
- the input stream containing the image data- Returns:
- the Base64 encoded string representing the image
- Throws:
IOException
- if an I/O error occurs while reading the input stream
-