loci.formats.in

## Class APNGReader.PNGInputStream

- java.lang.Object
- - java.io.InputStream
  - - loci.formats.in.APNGReader.PNGInputStream

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable
  Enclosing class:
    APNGReader

      class APNGReader.PNGInputStream
      extends java.io.InputStream

  InputStream implementation that stitches together IDAT blocks into a seamless zlib stream. This allows us to decompress the image data without reading the entire compressed stream into a byte array.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `blockLength`
    `private int` | `blockPointer`
    `private java.lang.String` | `blockType`
    `private int` | `currentBlock`
    `private int` | `fctlCount`
    `private boolean` | `fdatValid`
    `private int` | `imageNumber`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PNGInputStream(java.lang.String blockType)`
    `PNGInputStream(java.lang.String blockType, int imageNumber)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `advanceBlock()`
    `int` | `available()`
    `int` | `read()`
    `int` | `read(byte[] b, int off, int len)`
    `byte` | `readByte()`

    - ### Methods inherited from class java.io.InputStream

      `close, mark, markSupported, read, reset, skip`

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

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

- - ### Field Detail

    - #### currentBlock

          private int currentBlock

    - #### blockPointer

          private int blockPointer

    - #### blockLength

          private int blockLength

    - #### blockType

          private java.lang.String blockType

    - #### imageNumber

          private int imageNumber

    - #### fctlCount

          private int fctlCount

    - #### fdatValid

          private boolean fdatValid

  - ### Constructor Detail

    - #### PNGInputStream

          public PNGInputStream(java.lang.String blockType)
                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### PNGInputStream

          public PNGInputStream(java.lang.String blockType,
                                int imageNumber)
                         throws java.io.IOException

      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### available

          public int available()
                        throws java.io.IOException

      Overrides:
        `available` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### read

          public int read()
                   throws java.io.IOException

      Specified by:
        `read` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### readByte

          public byte readByte()
                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### read

          public int read(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException

      Overrides:
        `read` in class `java.io.InputStream`
      Throws:
        `java.io.IOException`

    - #### advanceBlock

          private void advanceBlock()
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

Copyright © 2026 Open Microscopy Environment