com.informix.asf

## Class IfxDataInputStream

- java.lang.Object
- - java.io.InputStream
  - - java.io.FilterInputStream
    - - com.informix.asf.IfxDataInputStream

All Implemented Interfaces:
  java.io.Closeable, java.lang.AutoCloseable

Direct Known Subclasses:
  IfxDebugDataInputStream

    public class IfxDataInputStream
    extends java.io.FilterInputStream

This class is the informix input stream class to read the informix datatypes from an InputStream.

### Field Summary

### Fields inherited from class java.io.FilterInputStream

`in`

### Constructor Summary

Constructors
Constructor and Description
`IfxDataInputStream(java.io.InputStream i)`
`IfxDataInputStream(java.io.InputStream i, boolean encoption)`

### Method Summary

Methods
`protected void` `clearTrace()`
`void` `closeStream()`
`java.lang.String` `getClientLocale()` Return the class variable ClientLocale.
`int` `read()` reads a byte from the inputstream.
`int` `read(byte[] b)` reads into an array of bytes.
`int` `read(byte[] b, int offset, int length)` reads into an array of bytes.
`byte` `readByte()`
`java.lang.String` `readChar()` Reads an informix string from the inputstream.
`java.lang.String` `readChar(java.lang.String dbEnc)`
`java.sql.Date` `readDate()` Reads an Informix date from the stream.
`java.sql.Timestamp` `readDateTime(short prec)` Reads an Informix datetime from the stream.
`java.math.BigDecimal` `readDecimal(short prec)` Reads an Informix decimal from the stream.
`double` `readDouble(short prec)` Reads an Informix double from the stream.
`int` `readFully(byte[] b)` reads into an array of bytes.
`int` `readFully(byte[] b, int offset, int length)` reads into an array of bytes.
`int` `readInt()` Reads an informix Integer from the inputstream.
`Interval` `readInterval(short prec)` Reads an Informix interval from the stream.
`long` `readLong()` Reads an Informix int8 from the stream.
`long` `readLongBigint()` Reads an Informix bigint from the stream.
`long` `readLongInt()` Reads an Informix int8 from the stream.
`int` `readPadded(byte[] b)` reads into an array of bytes.
`int` `readPadded(byte[] b, int offset, int length)` reads into an array of bytes.
`byte[]` `readRawDateTime(short prec)` Reads an Informix datetime from the stream.
`float` `readReal(short prec)` Reads an Informix real from the stream.
`short` `readShort()` Reads an Informix smallint from the stream.
`short` `readSmallInt()` Reads an Informix smallint from the stream.
`void` `setClientLocale(java.lang.String loc)` Set the class variable ClientLocale.
`int` `skipBytes(int n)` Skips exactly `n` bytes of input in the underlying input stream.

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

`available, close, mark, markSupported, reset, skip`

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

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

### Constructor Detail

#### IfxDataInputStream

    public IfxDataInputStream(java.io.InputStream i)

#### IfxDataInputStream

    public IfxDataInputStream(java.io.InputStream i,
                      boolean encoption)

### Method Detail

#### read

    public int read()
             throws java.io.IOException

reads a byte from the inputstream. blocks till some input is available

Overrides:
  `read` in class `java.io.FilterInputStream`
Returns:
  the byte read from the inputstream.
Throws:
  `java.io.IOException` - In case of I/O error.

#### read

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

reads into an array of bytes. blocks till some input is available

Overrides:
  `read` in class `java.io.FilterInputStream`
Parameters:
  `b` - byte array to read into.
Returns:
  the number of bytes read or -1 if end of stream is reached
Throws:
  `java.io.IOException` - In case of I/O error.

#### readByte

    public byte readByte()
                  throws java.io.IOException

Throws:
  `java.io.IOException`

#### readFully

    public int readFully(byte[] b)
                  throws java.io.IOException

reads into an array of bytes. blocks till all input is available

Parameters:
  `b` - byte array to read into.
Returns:
  the number of bytes read or -1 if end of stream is reached
Throws:
  `java.io.IOException` - In case of I/O error.

#### read

    public int read(byte[] b,
           int offset,
           int length)
             throws java.io.IOException

reads into an array of bytes. blocks till some input is available

Overrides:
  `read` in class `java.io.FilterInputStream`
Parameters:
  `b` - byte array to read into.
  `offset` - the offset of the data.
  `length` - the maximum number of bytes to read.
Returns:
  the number of bytes read or -1 if end of stream is reached
Throws:
  `java.io.IOException` - In case of I/O error.

#### readFully

    public int readFully(byte[] b,
                int offset,
                int length)
                  throws java.io.IOException

reads into an array of bytes. blocks till all input is available

Parameters:
  `b` - byte array to read into.
  `offset` - the offset of the data.
  `length` - the maximum number of bytes to read.
Returns:
  the number of bytes read or -1 if end of stream is reached
Throws:
  `java.io.IOException` - In case of I/O error.

#### readPadded

    public int readPadded(byte[] b,
                 int offset,
                 int length)
                   throws java.io.IOException

reads into an array of bytes. Reads the pad byte if needed blocks till all requested input is available

Parameters:
  `b` - byte array to read into.
  `offset` - the offset of the data.
  `length` - the maximum number of bytes to read.
Returns:
  the number of bytes read or -1 if end of stream is reached
Throws:
  `java.io.IOException` - In case of I/O error.

#### readPadded

    public int readPadded(byte[] b)
                   throws java.io.IOException

reads into an array of bytes. Reads the pad byte if necessary. blocks till all requested input are available

Parameters:
  `b` - byte array to read into.
  `offset` - the offset of the data.
  `length` - the maximum number of bytes to read.
Returns:
  the number of bytes read or -1 if end of stream is reached
Throws:
  `java.io.IOException` - In case of I/O error.

#### skipBytes

    public int skipBytes(int n)
                  throws java.io.IOException

Skips exactly `n` bytes of input in the underlying input stream. This method blocks until all the bytes are skipped, the end of the stream is detected, or an exception is thrown.

Parameters:
  `n` - the number of bytes to be skipped.
Returns:
  the number of bytes skipped, which is always `n`.
Throws:
  `java.io.EOFException` - if this input stream reaches the end before skipping all the bytes.
  `java.io.IOException` - if an I/O error occurs.

#### readInt

    public int readInt()
                throws java.io.IOException

Reads an informix Integer from the inputstream. blocks till all input is available

Returns:
  the integer converted to a java integer.
Throws:
  `java.io.IOException` - In case of I/O error.

#### readChar

    public java.lang.String readChar()
                              throws java.io.IOException,
                                     IfxASFException

Reads an informix string from the inputstream. blocks till all input is available

Returns:
  the Char(n) converted to a java String. This method does not conform to the standard DataInputStream method signature for readChar() since it returns a string rather than a char.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxJamException` - In case the length of the data is < 0.
  `IfxASFException`

#### readChar

    public java.lang.String readChar(java.lang.String dbEnc)
                              throws java.io.IOException,
                                     IfxASFException

Throws:
  `java.io.IOException`
  `IfxASFException`

#### readDate

    public java.sql.Date readDate()
                           throws java.io.IOException,
                                  IfxASFException

Reads an Informix date from the stream. blocks till all input is available

Returns:
  the date converted to a java.sql.Date.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxASFException` - In case the length of the data is < 0.

#### readDateTime

    public java.sql.Timestamp readDateTime(short prec)
                                    throws java.io.IOException,
                                           IfxASFException

Reads an Informix datetime from the stream. blocks till all input is available

Returns:
  the datetime converted to a java.sql.Timestamp.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxASFException` - In case the length of the data is < 0.

#### readRawDateTime

    public byte[] readRawDateTime(short prec)
                           throws java.io.IOException,
                                  IfxASFException

Reads an Informix datetime from the stream. blocks till all input is available

Returns:
  the datetime as raw data.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxASFException` - In case the length of the data is < 0.

#### readInterval

    public Interval readInterval(short prec)
                          throws java.io.IOException,
                                 IfxASFException

Reads an Informix interval from the stream. blocks till all input is available

Returns:
  the interval converted to a java.lang.IntervalYM.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxASFException` - In case the length of the data is < 0.

#### readDecimal

    public java.math.BigDecimal readDecimal(short prec)
                                     throws java.io.IOException,
                                            IfxASFException

Reads an Informix decimal from the stream. blocks till all input is available

Returns:
  the decimal converted to a java.lang.Bignum.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxASFException` - In case the length of the data is < 0.

#### readDouble

    public double readDouble(short prec)
                      throws java.io.IOException,
                             IfxASFException

Reads an Informix double from the stream. blocks till all input is available

Returns:
  the double converted to a java double.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxASFException` - In case the length of the data is < 0.

#### readReal

    public float readReal(short prec)
                   throws java.io.IOException,
                          IfxASFException

Reads an Informix real from the stream. blocks till all input is available

Returns:
  the real converted to a java float.
Throws:
  `java.io.IOException` - In case of I/O error.
  `IfxASFException` - In case the length of the data is < 0.

#### readSmallInt

    public short readSmallInt()
                       throws java.io.IOException

Reads an Informix smallint from the stream. blocks till all input is available

Returns:
  the smallint converted to a java short.
Throws:
  `java.io.IOException` - In case of I/O error.

#### readShort

    public short readShort()
                    throws java.io.IOException

Reads an Informix smallint from the stream. blocks till all input is available

Returns:
  the smallint converted to a java short.
Throws:
  `java.io.IOException` - In case of I/O error.

#### readLongInt

    public long readLongInt()
                     throws java.io.IOException

Reads an Informix int8 from the stream. blocks till all input is available

Returns:
  the smallint converted to a java short.
Throws:
  `java.io.IOException` - In case of I/O error.

#### readLong

    public long readLong()
                  throws java.io.IOException

Reads an Informix int8 from the stream. blocks till all input is available

Returns:
  the smallint converted to a java short.
Throws:
  `java.io.IOException` - In case of I/O error.

#### setClientLocale

    public void setClientLocale(java.lang.String loc)

Set the class variable ClientLocale. ClientLocale is the locale of any exception/error output. null defaults to the default (English).

Parameters:
  `loc` -

#### getClientLocale

    public java.lang.String getClientLocale()

Return the class variable ClientLocale. ClientLocale is the locale of any exception/error output.

Parameters:
  `loc` -

#### readLongBigint

    public long readLongBigint()
                        throws java.io.IOException

Reads an Informix bigint from the stream. blocks till all input is available

Returns:
  the bigint converted to a java long.
Throws:
  `java.io.IOException` - In case of I/O error.

#### closeStream

    public void closeStream()

#### clearTrace

    protected void clearTrace()