com.informix.jdbc

## Class IfxBlob

- java.lang.Object
- - com.informix.jdbc.IfxObject
  - - com.informix.jdbc.IfxBlob

    public class IfxBlob
    extends IfxObject

Support for Blob datatypes. This class derived from IfxObject class.

See Also:
  `IfxObject`

### Field Summary

Fields
`protected static short` `BLOB_TYPE_BYTES`
`protected static short` `BLOB_TYPE_STREAM`
`protected byte[]` `blobBuffer`
`protected byte[]` `blobDesc`
`protected java.io.InputStream` `BlobInputStream`
`protected static short` `BLOBISNULL`
`protected short` `blobType`
`protected short` `ifxType`
`protected boolean` `isBlob_loaded`
`protected int` `tb_end`
`protected short` `tb_flags`
`protected int` `tb_size`
`protected int` `tb_start`
`protected IfxTmpFile` `tempBlobFile`

### Fields inherited from class com.informix.jdbc.IfxObject

`conn, encodedLength, extendedID, extendedName, extendedOwner, isNull, jdbcType, sourceType, trace, typeMap, used_in_update`

### Constructor Summary

Constructors
Constructor and Description
`IfxBlob(byte[] blobBuffer)` IfxBlob() constructor will be called from setAsciiStream() method It takes two parameters.
`IfxBlob(java.io.InputStream fin, int length)` IfxBlob() constructor will be called from setAsciiStream() method It takes two parameters.

### Method Summary

Methods
`void` `clear()` Clear the instance states
`protected void` `finalize()`
`void` `fromAsciiStream(java.io.InputStream fin, int length)` Accepts the Input Stream data and make ready for sending to it to server.
`void` `fromBinaryStream(java.io.InputStream fin, int length)` Accepts the Input Stream data and make ready for sending to it to server.
`void` `fromBlob(java.sql.Blob blob)` Accepts the blob object and make ready for sending to it to server.
`void` `fromBytes(byte[] blobBuffer)` Accepts the byte array data and make ready for sending to it to server.
`void` `fromCharacterStream(java.io.Reader x, int length)` Accepts the Reader data and make ready for sending to it to server.
`void` `fromClob(java.sql.Clob clob)` Accepts the clob object and make ready for sending to it to server.
`void` `fromIfx(byte[] b)` Set value of this data type to the given Informix network format
`void` `fromIfx(byte[] b, int offset, int size)` Set value of this data type to the given Informix network format
`void` `fromInputStream(java.io.InputStream fin, int length)` Accepts the Input Stream data and make ready for sending to it to server.
`void` `fromString(java.lang.String S)` Accepts the String data and make ready for sending to it to server.
`protected byte[]` `getBlobBuffer()`
`protected java.lang.String` `getBlobFileName()`
`protected java.io.InputStream` `getBlobInputStream()`
`protected int` `getBlobLength()`
`protected short` `getBlobType()`
`protected boolean` `isBlobByteType()`
`protected boolean` `isBlobLoaded()`
`protected boolean` `isIfxTextType()`
`protected void` `setBlobBuffer(byte[] buffer)`
`protected void` `setBlobFileName()`
`protected void` `setBlobLength(int size)`
`protected void` `setBlobLength(int size, int start, int end)`
`protected void` `setLoaded()`
`java.io.InputStream` `toAsciiStream()` Return the fetched blob data as an Input Stream.
`java.io.InputStream` `toBinaryStream()` Return the fetched blob data as an Input Stream.
`java.sql.Blob` `toBlob()`
`byte[]` `toBytes()` Return the fetched blob data as byte array.
`java.io.Reader` `toCharacterStream()`
`java.sql.Clob` `toClob()`
`byte[]` `toIfx()` Convert value to Informix network format
`byte[]` `toIfxTuple()` Convert value to Informix tuple format
`java.lang.Object` `toObject()` Return the blob Object as byte array.
`java.lang.String` `toString()` Return the fetched blob data as String.

### Methods inherited from class com.informix.jdbc.IfxObject

`clearWarning, equals, fromAsciiStream, fromBinaryStream, fromBoolean, fromBoolean, fromByte, fromByte, fromCharacterStream, fromDate, fromDecimal, fromDecimal, fromDouble, fromDouble, fromFloat, fromFloat, fromIfx, fromIfx, fromIfx, fromIfx, fromInputStream, fromInt, fromInt, fromIntervalDF, fromIntervalYM, fromLong, fromLong, fromObject, fromObject, fromObject, fromShort, fromShort, fromString, fromTime, fromTimestamp, get_used_in_update, getEncodedLength, getWarning, isNull, nullify, set_used_in_update, setConnection, setExtendedTypeName, setIfxType, setTypeMap, toBoolean, toByte, toDate, toDecimal, toDouble, toFloat, toIfxBSONObject, toInputStream, toInt, toInterval, toIntervalDF, toIntervalYM, toLong, toObject, toShort, toTime, toTimestamp, toUnloadString, unnullify`

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

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

### Field Detail

#### BLOBISNULL

    protected static final short BLOBISNULL

See Also:
  Constant Field Values

#### BLOB_TYPE_BYTES

    protected static final short BLOB_TYPE_BYTES

See Also:
  Constant Field Values

#### BLOB_TYPE_STREAM

    protected static final short BLOB_TYPE_STREAM

See Also:
  Constant Field Values

#### blobDesc

    protected byte[] blobDesc

#### tb_start

    protected int tb_start

#### tb_end

    protected int tb_end

#### tb_size

    protected int tb_size

#### tb_flags

    protected short tb_flags

#### BlobInputStream

    protected java.io.InputStream BlobInputStream

#### tempBlobFile

    protected IfxTmpFile tempBlobFile

#### blobBuffer

    protected byte[] blobBuffer

#### blobType

    protected short blobType

#### isBlob_loaded

    protected boolean isBlob_loaded

#### ifxType

    protected short ifxType

### Constructor Detail

#### IfxBlob

    public IfxBlob(java.io.InputStream fin,
           int length)
            throws java.sql.SQLException

IfxBlob() constructor will be called from setAsciiStream() method It takes two parameters. param1 InputStream ; param2 the length of blob data. throws SQLException.

Throws:
  `java.sql.SQLException`

#### IfxBlob

    public IfxBlob(byte[] blobBuffer)
            throws java.sql.SQLException

IfxBlob() constructor will be called from setAsciiStream() method It takes two parameters. param1 byte[] ; throws SQLException.

Throws:
  `java.sql.SQLException`

### Method Detail

#### getBlobType

    protected short getBlobType()

#### isBlobByteType

    protected boolean isBlobByteType()

#### isIfxTextType

    protected boolean isIfxTextType()

#### getBlobBuffer

    protected byte[] getBlobBuffer()

#### setBlobBuffer

    protected void setBlobBuffer(byte[] buffer)

#### getBlobLength

    protected int getBlobLength()

#### setBlobLength

    protected void setBlobLength(int size,
                     int start,
                     int end)

#### setBlobLength

    protected void setBlobLength(int size)

#### getBlobInputStream

    protected java.io.InputStream getBlobInputStream()

#### getBlobFileName

    protected java.lang.String getBlobFileName()

#### setBlobFileName

    protected void setBlobFileName()

#### isBlobLoaded

    protected boolean isBlobLoaded()

#### setLoaded

    protected void setLoaded()

#### fromIfx

    public void fromIfx(byte[] b)
                 throws java.sql.SQLException

Set value of this data type to the given Informix network format

Overrides:
  `fromIfx` in class `IfxObject`
Parameters:
  `b` - a byte array representation of this data type in Informix network format.
Throws:
  `java.sql.SQLException`

#### fromIfx

    public void fromIfx(byte[] b,
               int offset,
               int size)
                 throws java.sql.SQLException

Set value of this data type to the given Informix network format

Overrides:
  `fromIfx` in class `IfxObject`
Parameters:
  `b` - a byte array representation of this data type in Informix network format.
  `offset` - offset into the byte array where the blob data starts
  `size` - size of blob data
Throws:
  `java.sql.SQLException`

#### toIfx

    public byte[] toIfx()

Convert value to Informix network format

Overrides:
  `toIfx` in class `IfxObject`
Returns:
  a byte array representation of this data type in Informix network format.

#### toIfxTuple

    public byte[] toIfxTuple()

Convert value to Informix tuple format

Overrides:
  `toIfxTuple` in class `IfxObject`
Returns:
  a byte array representation of this data type in Informix tuple format.

#### toAsciiStream

    public java.io.InputStream toAsciiStream()
                                      throws java.sql.SQLException

Return the fetched blob data as an Input Stream.

Overrides:
  `toAsciiStream` in class `IfxObject`
Returns:
  InputStream.
Throws:
  `java.sql.SQLException`

#### fromInputStream

    public void fromInputStream(java.io.InputStream fin,
                       int length)
                         throws java.sql.SQLException

Accepts the Input Stream data and make ready for sending to it to server.

Overrides:
  `fromInputStream` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### fromCharacterStream

    public void fromCharacterStream(java.io.Reader x,
                           int length)
                             throws java.sql.SQLException

Accepts the Reader data and make ready for sending to it to server.

Overrides:
  `fromCharacterStream` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toCharacterStream

    public java.io.Reader toCharacterStream()
                                     throws java.sql.SQLException

Overrides:
  `toCharacterStream` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### fromAsciiStream

    public void fromAsciiStream(java.io.InputStream fin,
                       int length)
                         throws java.sql.SQLException

Accepts the Input Stream data and make ready for sending to it to server.

Overrides:
  `fromAsciiStream` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toBinaryStream

    public java.io.InputStream toBinaryStream()
                                       throws java.sql.SQLException

Return the fetched blob data as an Input Stream.

Overrides:
  `toBinaryStream` in class `IfxObject`
Returns:
  InputStream.
Throws:
  `java.sql.SQLException`

#### fromBinaryStream

    public void fromBinaryStream(java.io.InputStream fin,
                        int length)
                          throws java.sql.SQLException

Accepts the Input Stream data and make ready for sending to it to server.

Overrides:
  `fromBinaryStream` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toString

    public java.lang.String toString()

Return the fetched blob data as String.

Overrides:
  `toString` in class `IfxObject`
Returns:
  String.

#### fromString

    public void fromString(java.lang.String S)
                    throws java.sql.SQLException

Accepts the String data and make ready for sending to it to server.

Overrides:
  `fromString` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toObject

    public java.lang.Object toObject()
                              throws java.sql.SQLException

Return the blob Object as byte array.

Overrides:
  `toObject` in class `IfxObject`
Returns:
  byte[].
Throws:
  `java.sql.SQLException`

#### toBytes

    public byte[] toBytes()
                   throws java.sql.SQLException

Return the fetched blob data as byte array.

Overrides:
  `toBytes` in class `IfxObject`
Returns:
  byte array.
Throws:
  `java.sql.SQLException`

#### fromBytes

    public void fromBytes(byte[] blobBuffer)

Accepts the byte array data and make ready for sending to it to server.

Overrides:
  `fromBytes` in class `IfxObject`

#### toBlob

    public java.sql.Blob toBlob()
                         throws java.sql.SQLException

Overrides:
  `toBlob` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### toClob

    public java.sql.Clob toClob()
                         throws java.sql.SQLException

Overrides:
  `toClob` in class `IfxObject`
Throws:
  `java.sql.SQLException`

#### fromBlob

    public void fromBlob(java.sql.Blob blob)
                  throws java.sql.SQLException

Accepts the blob object and make ready for sending to it to server.

Overrides:
  `fromBlob` in class `IfxObject`
Throws:
  `java.sql.SQLException` - if invalid parameters

#### fromClob

    public void fromClob(java.sql.Clob clob)
                  throws java.sql.SQLException

Accepts the clob object and make ready for sending to it to server.

Overrides:
  `fromClob` in class `IfxObject`
Throws:
  `java.sql.SQLException` - if invalid parameters

#### clear

    public void clear()

Description copied from class: `IfxObject`
Clear the instance states

Overrides:
  `clear` in class `IfxObject`

#### finalize

    protected void finalize()

Overrides:
  `finalize` in class `java.lang.Object`