com.pivotal.gemfirexd.internal.client.net

## Class EncodedInputStream

- java.lang.Object
- - java.io.InputStream
  - - com.pivotal.gemfirexd.internal.client.net.EncodedInputStream

All Implemented Interfaces:
  Closeable, AutoCloseable

    public final class EncodedInputStream
    extends InputStream

Create an encoded stream from a `Reader`. This is an internal class, used to pass readers of characters as streams of bytes. The characters will be represented according to the specified encoding. It is up to the caller to ensure the specified encoding is available, and in general only encodings available as default from Java 1.3 and up should be used. Currently, the encodings 'UTF8' and 'UTF-16BE' are used. Streams are obtained by calling the static methods of this class, for instance `createUTF8Stream`.

### Method Summary

Methods
`int` `available()`
`void` `close()`
`static EncodedInputStream` `createUTF8Stream(Reader reader)` Create a UTF-8 encoded stream from the given `Reader`.
`protected void` `finalize()`
`int` `read()`

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

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

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

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

### Method Detail

#### createUTF8Stream

    public static EncodedInputStream createUTF8Stream(Reader reader)

Create a UTF-8 encoded stream from the given `Reader`.

Parameters:
  `reader` - the `Reader` to read characters from.
Returns:
  a byte-stream with UTF-8 encoded characters

#### available

    public int available()
                  throws IOException

Overrides:
  `available` in class `InputStream`
Throws:
  `IOException`

#### close

    public void close()
               throws IOException

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

#### read

    public int read()
             throws IOException

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

#### finalize

    protected void finalize()
                     throws IOException

Overrides:
  `finalize` in class `Object`
Throws:
  `IOException`