com.fasterxml.aalto.in

## Class Utf32Reader

- java.lang.Object
- - java.io.Reader
  - - com.fasterxml.aalto.in.Utf32Reader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Readable

      public final class Utf32Reader
      extends Reader

  Since JDK does not come with UTF-32/UCS-4, let's implement a simple decoder to use.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected byte[]` | `mBuffer`
    `protected InputStream` | `mIn`
    `protected int` | `mLength`
    `protected int` | `mPtr`

    - ### Fields inherited from class java.io.Reader

      `lock`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Utf32Reader(ReaderConfig cfg, InputStream in, byte[] buf, int ptr, int len, boolean isBigEndian)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `freeBuffers()`
    `int` | `read()` Although this method is implemented by the base class, AND it should never be called by Woodstox code, let's still implement it bit more efficiently just in case
    `int` | `read(char[] cbuf, int start, int len)`
    `protected void` | `reportBounds(char[] cbuf, int start, int len)`
    `protected void` | `reportStrangeStream()`

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

      `mark, markSupported, read, read, ready, reset, skip`

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

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

- - ### Field Detail

    - #### mIn

          protected InputStream mIn

    - #### mBuffer

          protected byte[] mBuffer

    - #### mPtr

          protected int mPtr

    - #### mLength

          protected int mLength

  - ### Constructor Detail

    - #### Utf32Reader

          public Utf32Reader(ReaderConfig cfg,
                     InputStream in,
                     byte[] buf,
                     int ptr,
                     int len,
                     boolean isBigEndian)

  - ### Method Detail

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in class `Reader`
      Throws:
        `IOException`

    - #### read

          public int read()
                   throws IOException

      Although this method is implemented by the base class, AND it should never be called by Woodstox code, let's still implement it bit more efficiently just in case
      Overrides:
        `read` in class `Reader`
      Throws:
        `IOException`

    - #### read

          public int read(char[] cbuf,
                 int start,
                 int len)
                   throws IOException

      Specified by:
        `read` in class `Reader`
      Throws:
        `IOException`

    - #### freeBuffers

          public final void freeBuffers()

    - #### reportBounds

          protected void reportBounds(char[] cbuf,
                          int start,
                          int len)
                               throws IOException

      Throws:
        `IOException`

    - #### reportStrangeStream

          protected void reportStrangeStream()
                                      throws IOException

      Throws:
        `IOException`

Copyright © 2012-2015 FasterXML. All Rights Reserved.