Interface Favicon
public sealed interface Favicon
A favicon encoded as PNG image data.
Status responses require favicons to be 64 by 64 pixels. Factory methods validate the source image and encode it as PNG data.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]data()Gets the PNG-encoded favicon image data.static Faviconof(BufferedImage image) Creates a favicon from an image.static Faviconread(InputStream stream) Reads a favicon from an image stream.static FaviconReads a favicon from an image file.
-
Method Details
-
data
@Contract(value=" -> new", pure=true) byte[] data()Gets the PNG-encoded favicon image data.- Returns:
- a clone of the favicon data
- Since:
- 0.1.0
-
read
Reads a favicon from an image file.- Parameters:
path- path to the image file- Returns:
- favicon encoded as PNG data
- Throws:
IOException- if the image cannot be read or encodedIllegalArgumentException- if the image format is unsupported or the image is not 64 by 64 pixels- Since:
- 0.1.0
-
read
Reads a favicon from an image stream.- Parameters:
stream- stream containing image data- Returns:
- favicon encoded as PNG data
- Throws:
IOException- if the image cannot be read or encodedIllegalArgumentException- if the image format is unsupported or the image is not 64 by 64 pixels- Since:
- 0.1.0
-
of
Creates a favicon from an image.- Parameters:
image- source image- Returns:
- favicon encoded as PNG data
- Throws:
IOException- if the image cannot be encodedIllegalArgumentException- if the image is not 64 by 64 pixels- Since:
- 0.1.0
-