Class Icon

    • Method Detail

      • getEncoding

        @Nonnull
        public String getEncoding()
        The base64 encoded data for this Icon
        Returns:
        String representation of the encoded data for this icon
      • from

        @Nonnull
        public static Icon from​(@Nonnull
                                InputStream stream)
                         throws IOException
        Creates an Icon with the specified InputStream.
        We here read the specified InputStream and forward the retrieved byte data to from(byte[], IconType). This will use Icon.IconType.JPEG but discord is capable for interpreting other types correctly either way.
        Parameters:
        stream - A not-null InputStream.
        Returns:
        An Icon instance representing the specified InputStream
        Throws:
        IllegalArgumentException - if the provided stream is null
        IOException - If the first byte cannot be read for any reason other than the end of the file, if the input stream has been closed, or if some other I/O error occurs.
      • from

        @Nonnull
        public static Icon from​(@Nonnull
                                byte[] data)
        Creates an Icon with the specified image data. This will use Icon.IconType.JPEG but discord is capable for interpreting other types correctly either way.
        Parameters:
        data - not-null image data bytes.
        Returns:
        An Icon instance representing the specified image data
        Throws:
        IllegalArgumentException - if the provided data is null