com.informix.jdbc

## Class IfxSmBlob

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

    public class IfxSmBlob
    extends IfxObject

Support for Clob/Blob datatypes. This class derived from IfxBaseType class.

See Also:
  `IfxBaseType`

### Field Summary

Fields
`protected static short` `BLOB_BUFFER_SIZE`
`protected static short` `BLOB_TYPE_BYTES`
`protected static short` `BLOB_TYPE_CHARSTREAM`
`protected static short` `BLOB_TYPE_STREAM`
`protected byte[]` `blobBuffer`
`protected java.io.Reader` `BlobCharInputStream`
`protected java.io.InputStream` `BlobInputStream`
`protected short` `blobType`
`protected java.lang.String` `columnName`
`protected static short` `EACCES`
`protected static short` `EBADF`
`protected static short` `EEXIST`
`protected static short` `EIO`
`protected static short` `ENOENT`
`protected static short` `ESPIPE`
`protected static short` `FILE_CLOSE`
`protected static short` `FILE_OPEN`
`protected static short` `FILE_READ`
`protected static short` `FILE_WRITE`
`protected short` `IfxSmBlobType`
`protected IfxUDTInput` `inputStream`
`protected boolean` `isBlob_loaded`
`protected static int` `LO_O_APPEND`
`protected static int` `LO_O_BINARY`
`protected static int` `LO_O_EXCL`
`protected static int` `LO_O_RDONLY`
`protected static int` `LO_O_RDWR`
`protected static int` `LO_O_TEXT`
`protected static int` `LO_O_TRUNC`
`protected static int` `LO_O_WRONLY`
`protected static short` `LO_READ`
`protected static short` `LO_READWITHSEEK`
`protected static short` `LO_WRITE`
`protected boolean` `LOB_ELEMENT_COLL`
`protected IfxLocator` `locator`
`protected int` `loFd`
`protected IfxUDTOutput` `outputStream`
`protected static short` `R_W_BUFSIZE`
`protected long` `sm_size`
`protected java.lang.String` `tableName`
`protected IfxTmpFile` `tempBlobFile`
`protected static int` `UDT_FLAG_SIZE`
`protected static int` `UDT_LENGTH_SIZE`

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

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

### Constructor Summary

Constructors
Constructor and Description
`IfxSmBlob()` IfxSmBlob() constructor with no argument
`IfxSmBlob(java.sql.Blob blob)` IfxSmBlob() constructor will be called from setCLOB/BLOB() method It takes one parameters.
`IfxSmBlob(byte[] blobBuffer)` IfxSmBlob() constructor will be called from setBytes() method param1 byte[] ; throws SQLException.
`IfxSmBlob(java.sql.Clob clob)` IfxSmBlob() constructor will be called from setCLOB/BLOB() method It takes one parameters.
`IfxSmBlob(IfxConnection conn, IfxLocator loc)` IfxSmBlob(IfxLocator loc) Constructor given an locator.
`IfxSmBlob(java.io.InputStream fin, int length)` IfxSmBlob() 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 reader, int length)` Accepts the Reader and makes it ready for sending to the 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 length)` Set value of this data type to the given Informix network format
`protected void` `fromIfxFP(byte[] b)`
`void` `fromInputStream(java.io.InputStream fi, int len)` Accepts the Input Stream data and make ready for sending to it to server.
`void` `fromObject(java.lang.Object obj)` Accepts the Object and create a Blob/Clob Object.
`void` `fromString(java.lang.String S)` Accepts the String data and make ready for sending to it to server.
`void` `setColumnName(java.lang.String cn)`
`void` `setConnection(IfxConnection conn)` GENERIC
`void` `setTableName(java.lang.String tn)`
`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()` Return the fetched blob data as a blob object
`byte[]` `toBytes()` Return the fetched blob data as byte array.
`java.io.Reader` `toCharacterStream()`
`java.sql.Clob` `toClob()` Return the fetched blob data as a clob object
`java.sql.Clob` `toClob(int mode)` Return the fetched blob data as a clob object
`byte[]` `toIfx()` Convert value to Informix network format
`byte[]` `toIfxTuple()` Convert value to Informix tuple format
`java.lang.Object` `toObject()` Return the blob/clob Object as Object
`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, fromShort, fromShort, fromString, fromTime, fromTimestamp, get_used_in_update, getEncodedLength, getWarning, isNull, nullify, set_used_in_update, 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

#### BLOB_BUFFER_SIZE

    protected static final short BLOB_BUFFER_SIZE

See Also:
  Constant Field Values

#### LO_READ

    protected static final short LO_READ

See Also:
  Constant Field Values

#### LO_READWITHSEEK

    protected static final short LO_READWITHSEEK

See Also:
  Constant Field Values

#### LO_WRITE

    protected static final short LO_WRITE

See Also:
  Constant Field Values

#### R_W_BUFSIZE

    protected static final short R_W_BUFSIZE

See Also:
  Constant Field Values

#### FILE_OPEN

    protected static final short FILE_OPEN

See Also:
  Constant Field Values

#### FILE_CLOSE

    protected static final short FILE_CLOSE

See Also:
  Constant Field Values

#### FILE_READ

    protected static final short FILE_READ

See Also:
  Constant Field Values

#### FILE_WRITE

    protected static final short FILE_WRITE

See Also:
  Constant Field Values

#### LO_O_EXCL

    protected static final int LO_O_EXCL

See Also:
  Constant Field Values

#### LO_O_APPEND

    protected static final int LO_O_APPEND

See Also:
  Constant Field Values

#### LO_O_TRUNC

    protected static final int LO_O_TRUNC

See Also:
  Constant Field Values

#### LO_O_RDWR

    protected static final int LO_O_RDWR

See Also:
  Constant Field Values

#### LO_O_RDONLY

    protected static final int LO_O_RDONLY

See Also:
  Constant Field Values

#### LO_O_WRONLY

    protected static final int LO_O_WRONLY

See Also:
  Constant Field Values

#### LO_O_BINARY

    protected static final int LO_O_BINARY

See Also:
  Constant Field Values

#### LO_O_TEXT

    protected static final int LO_O_TEXT

See Also:
  Constant Field Values

#### EIO

    protected static final short EIO

See Also:
  Constant Field Values

#### ENOENT

    protected static final short ENOENT

See Also:
  Constant Field Values

#### EBADF

    protected static final short EBADF

See Also:
  Constant Field Values

#### EACCES

    protected static final short EACCES

See Also:
  Constant Field Values

#### EEXIST

    protected static final short EEXIST

See Also:
  Constant Field Values

#### ESPIPE

    protected static final short ESPIPE

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

#### BLOB_TYPE_CHARSTREAM

    protected static final short BLOB_TYPE_CHARSTREAM

See Also:
  Constant Field Values

#### LOB_ELEMENT_COLL

    protected boolean LOB_ELEMENT_COLL

#### locator

    protected IfxLocator locator

#### loFd

    protected int loFd

#### sm_size

    protected long sm_size

#### BlobInputStream

    protected java.io.InputStream BlobInputStream

#### BlobCharInputStream

    protected java.io.Reader BlobCharInputStream

#### tempBlobFile

    protected IfxTmpFile tempBlobFile

#### blobBuffer

    protected byte[] blobBuffer

#### blobType

    protected short blobType

#### isBlob_loaded

    protected boolean isBlob_loaded

#### IfxSmBlobType

    protected short IfxSmBlobType

#### tableName

    protected java.lang.String tableName

#### columnName

    protected java.lang.String columnName

#### UDT_FLAG_SIZE

    protected static final int UDT_FLAG_SIZE

See Also:
  Constant Field Values

#### UDT_LENGTH_SIZE

    protected static final int UDT_LENGTH_SIZE

See Also:
  Constant Field Values

#### inputStream

    protected IfxUDTInput inputStream

#### outputStream

    protected IfxUDTOutput outputStream

### Constructor Detail

#### IfxSmBlob

    public IfxSmBlob()
              throws java.sql.SQLException

IfxSmBlob() constructor with no argument

Throws:
  `java.sql.SQLException`

#### IfxSmBlob

    public IfxSmBlob(IfxConnection conn,
             IfxLocator loc)
              throws java.sql.SQLException

IfxSmBlob(IfxLocator loc) Constructor given an locator. We need to open the locator on the server

Throws:
  `java.sql.SQLException`

#### IfxSmBlob

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

IfxSmBlob() 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`

#### IfxSmBlob

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

IfxSmBlob() constructor will be called from setBytes() method param1 byte[] ; throws SQLException.

Throws:
  `java.sql.SQLException`

#### IfxSmBlob

    public IfxSmBlob(java.sql.Blob blob)
              throws java.sql.SQLException

IfxSmBlob() constructor will be called from setCLOB/BLOB() method It takes one parameters. param1 Blob ; throws SQLException.

Throws:
  `java.sql.SQLException`

#### IfxSmBlob

    public IfxSmBlob(java.sql.Clob clob)
              throws java.sql.SQLException

IfxSmBlob() constructor will be called from setCLOB/BLOB() method It takes one parameters. param1 Clob ; throws SQLException.

Throws:
  `java.sql.SQLException`

### Method Detail

#### setTableName

    public void setTableName(java.lang.String tn)

#### setColumnName

    public void setColumnName(java.lang.String cn)

#### fromIfx

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

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

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 length)
                 throws java.sql.SQLException

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

Parameters:
  `b` - a byte array representation of this data type in Informix network format.
  `offset` - into byte array
  `length` - data length
Throws:
  `java.sql.SQLException`

#### fromIfxFP

    protected void fromIfxFP(byte[] b)
                      throws java.sql.SQLException

Throws:
  `java.sql.SQLException`

#### toIfx

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

Convert value to Informix network format

Returns:
  a byte array representation of this data type in Informix network format.
Throws:
  `java.sql.SQLException`

#### toIfxTuple

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

Convert value to Informix tuple format

Returns:
  a byte array representation of this data type in Informix network format.
Throws:
  `java.sql.SQLException`

#### 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 fi,
                       int len)
                         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 reader,
                           int length)
                             throws java.sql.SQLException

Accepts the Reader and makes it ready for sending to the server.

Overrides:
  `fromCharacterStream` 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/clob Object as Object

Overrides:
  `toObject` in class `IfxObject`
Returns:
  Object
Throws:
  `java.sql.SQLException`

#### fromObject

    public void fromObject(java.lang.Object obj)
                    throws java.sql.SQLException

Accepts the Object and create a Blob/Clob Object. param1 Object.

Overrides:
  `fromObject` in class `IfxObject`
Parameters:
  `obj` - Convert the data value from obj to IfxObject
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)
                   throws java.sql.SQLException

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

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

#### toBlob

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

Return the fetched blob data as a blob object

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

#### toClob

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

Return the fetched blob data as a clob object

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

#### toClob

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

Return the fetched blob data as a clob object

Returns:
  clob .
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`

#### 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`

#### 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`

#### toCharacterStream

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

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

#### setConnection

    public void setConnection(IfxConnection conn)
                       throws java.sql.SQLException

Description copied from class: `IfxObject`
GENERIC

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