Object Translator

com.informix.ormapper
Class OBlob

java.lang.Object
  |
  +--com.informix.ormapper.OBlob

public class OBlob
extends java.lang.Object

External: This is the utility class for manipulating a BLOB (binary large object) data type.

See Also:
OClob

Constructor Summary
OBlob()
          Constructs an empty BLOB object.
OBlob(java.sql.Blob _blob)
          Constructs a BLOB object from an existing java.sql.Blob object.
 
Method Summary
 java.io.InputStream getBinaryStream()
          Retrieves the BLOB data as a stream.
 java.sql.Blob getBlob()
          Retrieves the java.sql.Blob object reference set in a setBlob() call or a constructor.
 long length()
          Returns the number of bytes in the BLOB data designated by this BLOB object.
 void load(java.lang.String fileName)
          Loads the BLOB data from a file.
 void setBinaryStream(java.io.InputStream _in, long _length)
          Sets the BLOB data as an input stream.
 void setBlob(java.sql.Blob _blob)
          Sets the BLOB data from an existing java.sql.Blob object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OBlob

public OBlob()
Constructs an empty BLOB object.

OBlob

public OBlob(java.sql.Blob _blob)
Constructs a BLOB object from an existing java.sql.Blob object.
Parameters:
_blob - a java.sql.Blob object.
Method Detail

getBinaryStream

public java.io.InputStream getBinaryStream()
                                    throws DatabaseException
Retrieves the BLOB data as a stream.
Returns:
the data stream, or null if no BLOB or input stream has been set yet.

setBinaryStream

public void setBinaryStream(java.io.InputStream _in,
                            long _length)
Sets the BLOB data as an input stream.
Parameters:
_in - the data input stream.
_length - the length of the data input stream.

length

public long length()
            throws DatabaseException
Returns the number of bytes in the BLOB data designated by this BLOB object.
Returns:
length of the BLOB in bytes or -1 if there is no data stream or BLOB data.

load

public void load(java.lang.String fileName)
          throws java.io.FileNotFoundException
Loads the BLOB data from a file.
Parameters:
fileName - name of the file that contains BLOB data.

setBlob

public void setBlob(java.sql.Blob _blob)
Sets the BLOB data from an existing java.sql.Blob object.
Parameters:
_blob - a java.sql.Blob object.

getBlob

public java.sql.Blob getBlob()
Retrieves the java.sql.Blob object reference set in a setBlob() call or a constructor.
Returns:
the java.sql.Blob object representing BLOB data.

Object Translator

Copyright © 1999-2000 Informix Software, Inc.