loci.formats.services

## Class JAIIIOServiceImpl

- java.lang.Object
- - loci.common.services.AbstractService
  - - loci.formats.services.JAIIIOServiceImpl

- All Implemented Interfaces:
    loci.common.services.Service, JAIIIOService

      public class JAIIIOServiceImpl
      extends loci.common.services.AbstractService
      implements JAIIIOService

  Implementation of JAIIIOService for reading and writing JPEG-2000 data.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `NO_J2K_MSG`
    `private javax.imageio.spi.IIORegistry` | `serviceRegistry`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JAIIIOServiceImpl()` Default constructor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader` | `getReader()` Set up the JPEG-2000 image reader.
    `java.awt.image.BufferedImage` | `readImage(java.io.InputStream in)` Reads an image using JAI Image I/O using the JPEG 2000 codec.
    `java.awt.image.BufferedImage` | `readImage(java.io.InputStream in, JPEG2000CodecOptions options)` Reads an image using JAI Image I/O using the JPEG 2000 codec.
    `java.awt.image.Raster` | `readRaster(java.io.InputStream in)` Reads an image into a raster using JAI Image I/O using the JPEG 2000 codec.
    `java.awt.image.Raster` | `readRaster(java.io.InputStream in, JPEG2000CodecOptions options)` Reads an image into a raster using JAI Image I/O using the JPEG 2000 codec.
    `private static javax.imageio.spi.IIORegistry` | `registerServiceProviders()` Register the JPEG-2000 readers with the reader service.
    `void` | `writeImage(java.io.OutputStream out, java.awt.image.BufferedImage img, JPEG2000CodecOptions options)` Writes an image using JAI Image I/O using the JPEG 2000 codec.

    - ### Methods inherited from class loci.common.services.AbstractService

      `checkClassDependency`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NO_J2K_MSG

          public static final java.lang.String NO_J2K_MSG

    - #### serviceRegistry

          private javax.imageio.spi.IIORegistry serviceRegistry

  - ### Constructor Detail

    - #### JAIIIOServiceImpl

          public JAIIIOServiceImpl()

      Default constructor.

  - ### Method Detail

    - #### writeImage

          public void writeImage(java.io.OutputStream out,
                                 java.awt.image.BufferedImage img,
                                 JPEG2000CodecOptions options)
                          throws java.io.IOException,
                                 loci.common.services.ServiceException

      Description copied from interface: `JAIIIOService`
      Writes an image using JAI Image I/O using the JPEG 2000 codec.
      Specified by:
        `writeImage` in interface `JAIIIOService`
      Parameters:
        `out` - Target output stream.
        `img` - Source buffered image.
        `options` - Options for the JPEG 2000 codec.
      Throws:
        `java.io.IOException` - Thrown if there is an error reading from or writing to one of the target streams / buffers.
        `loci.common.services.ServiceException` - Thrown if there is an error initializing or interacting with the dependencies of the service.

    - #### readImage

          public java.awt.image.BufferedImage readImage(java.io.InputStream in,
                                                        JPEG2000CodecOptions options)
                                                 throws java.io.IOException,
                                                        loci.common.services.ServiceException

      Description copied from interface: `JAIIIOService`
      Reads an image using JAI Image I/O using the JPEG 2000 codec.
      Specified by:
        `readImage` in interface `JAIIIOService`
      Parameters:
        `in` - Target input stream.
        `options` - Options for the JPEG 2000 codec.
      Returns:
        An AWT buffered image.
      Throws:
        `java.io.IOException` - Thrown if there is an error reading from or writing to one of the target streams / buffers.
        `loci.common.services.ServiceException` - Thrown if there is an error initializing or interacting with the dependencies of the service.

    - #### readImage

          public java.awt.image.BufferedImage readImage(java.io.InputStream in)
                                                 throws java.io.IOException,
                                                        loci.common.services.ServiceException

      Description copied from interface: `JAIIIOService`
      Reads an image using JAI Image I/O using the JPEG 2000 codec.
      Specified by:
        `readImage` in interface `JAIIIOService`
      Parameters:
        `in` - Target input stream.
      Returns:
        An AWT buffered image.
      Throws:
        `java.io.IOException` - Thrown if there is an error reading from or writing to one of the target streams / buffers.
        `loci.common.services.ServiceException` - Thrown if there is an error initializing or interacting with the dependencies of the service.
      See Also:
        `JAIIIOService.readImage(InputStream, JPEG2000CodecOptions)`

    - #### readRaster

          public java.awt.image.Raster readRaster(java.io.InputStream in,
                                                  JPEG2000CodecOptions options)
                                           throws java.io.IOException,
                                                  loci.common.services.ServiceException

      Description copied from interface: `JAIIIOService`
      Reads an image into a raster using JAI Image I/O using the JPEG 2000 codec.
      Specified by:
        `readRaster` in interface `JAIIIOService`
      Parameters:
        `in` - Target input stream.
        `options` - Options for the JPEG 2000 codec.
      Returns:
        An AWT image raster.
      Throws:
        `java.io.IOException` - Thrown if there is an error reading from or writing to one of the target streams / buffers.
        `loci.common.services.ServiceException` - Thrown if there is an error initializing or interacting with the dependencies of the service.

    - #### readRaster

          public java.awt.image.Raster readRaster(java.io.InputStream in)
                                           throws java.io.IOException,
                                                  loci.common.services.ServiceException

      Description copied from interface: `JAIIIOService`
      Reads an image into a raster using JAI Image I/O using the JPEG 2000 codec.
      Specified by:
        `readRaster` in interface `JAIIIOService`
      Parameters:
        `in` - Target input stream.
      Returns:
        An AWT image raster.
      Throws:
        `java.io.IOException` - Thrown if there is an error reading from or writing to one of the target streams / buffers.
        `loci.common.services.ServiceException` - Thrown if there is an error initializing or interacting with the dependencies of the service.
      See Also:
        `JAIIIOService.readRaster(InputStream, JPEG2000CodecOptions)`

    - #### getReader

          private com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader getReader()

      Set up the JPEG-2000 image reader.

    - #### registerServiceProviders

          private static javax.imageio.spi.IIORegistry registerServiceProviders()

      Register the JPEG-2000 readers with the reader service.

Copyright © 2026 Open Microscopy Environment