Module org.htmlunit

Class Platform

java.lang.Object
org.htmlunit.platform.Platform

public final class Platform extends Object
Singleton to handle JDK specific stuff. This is required to support at least the differences with android.
Author:
Ronald Brill, Sven Strickroth
  • Method Details

    • getRenderingBackend

      public static RenderingBackend getRenderingBackend(int imageWidth, int imageHeight)
      Creates a rendering backend for an image with the specified dimensions.
      Parameters:
      imageWidth - the width of the image
      imageHeight - the height of the image
      Returns:
      a new RenderingBackend instance, or a NoOpRenderingBackend if the AwtRenderingBackend cannot be created
    • getFontUtil

      public static FontUtil getFontUtil()
      Returns the shared font utility instance.
      Returns:
      the shared FontUtil instance, or a NoOpFontUtil if the AwtFontUtil cannot be created
    • buildImageData

      public static ImageData buildImageData(InputStream inputStream) throws IOException
      Creates an ImageData instance by reading image data from the specified input stream.
      Parameters:
      inputStream - the InputStream to read from
      Returns:
      a new ImageData instance created from the specified input stream, or a NoOpImageData if image processing is unavailable
      Throws:
      IOException - if an I/O error occurs while reading the image data