com.metamatrix.common.types
Class BlobType

java.lang.Object
  extended by com.metamatrix.common.types.BlobType
All Implemented Interfaces:
Streamable, java.io.Serializable, java.sql.Blob

public final class BlobType
extends java.lang.Object
implements Streamable, java.sql.Blob

Represent a value of type "blob", which can be streamable from client

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.metamatrix.common.types.Streamable
FORCE_STREAMING, STREAMING_BATCH_SIZE_IN_BYTES
 
Constructor Summary
BlobType(java.sql.Blob blob)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 void free()
           
 java.io.InputStream getBinaryStream()
           
 java.io.InputStream getBinaryStream(long pos, long length)
           
static byte[] getByteArray(java.sql.Blob blob)
          Utility Method to convert blob into byte array
 byte[] getBytes(long pos, int length)
           
 java.lang.String getPersistenceStreamId()
          Persitence Stream ID in the server
 java.lang.String getReferenceStreamId()
          Reference Stream ID in the server
 java.sql.Blob getSourceBlob()
           
 long length()
           
 long position(java.sql.Blob pattern, long start)
           
 long position(byte[] pattern, long start)
           
 java.io.OutputStream setBinaryStream(long pos)
           
 int setBytes(long pos, byte[] bytes)
           
 int setBytes(long pos, byte[] bytes, int offset, int len)
           
 void setPersistenceStreamId(java.lang.String id)
          Persitence Stream ID in the server
 void setReferenceStreamId(java.lang.String id)
          Reference Stream ID in the server
 java.lang.String toString()
           
 void truncate(long len)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BlobType

public BlobType(java.sql.Blob blob)
Method Detail

getSourceBlob

public java.sql.Blob getSourceBlob()

getReferenceStreamId

public java.lang.String getReferenceStreamId()
Description copied from interface: Streamable
Reference Stream ID in the server

Specified by:
getReferenceStreamId in interface Streamable
Returns:
string - this is buffer managers tuple source id.
See Also:
Streamable.getReferenceStreamId()

setReferenceStreamId

public void setReferenceStreamId(java.lang.String id)
Description copied from interface: Streamable
Reference Stream ID in the server

Specified by:
setReferenceStreamId in interface Streamable
Parameters:
id - this is buffer managers tuple source id.
See Also:
Streamable.setReferenceStreamId(java.lang.String)

getPersistenceStreamId

public java.lang.String getPersistenceStreamId()
Description copied from interface: Streamable
Persitence Stream ID in the server

Specified by:
getPersistenceStreamId in interface Streamable
Returns:
string - this is buffer managers tuple source id.
See Also:
Streamable.getPersistenceStreamId()

setPersistenceStreamId

public void setPersistenceStreamId(java.lang.String id)
Description copied from interface: Streamable
Persitence Stream ID in the server

Specified by:
setPersistenceStreamId in interface Streamable
Parameters:
id - this is buffer managers tuple source id.
See Also:
Streamable.setPersistenceStreamId(java.lang.String)

getBinaryStream

public java.io.InputStream getBinaryStream()
                                    throws java.sql.SQLException
Specified by:
getBinaryStream in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.getBinaryStream()

getBytes

public byte[] getBytes(long pos,
                       int length)
                throws java.sql.SQLException
Specified by:
getBytes in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.getBytes(long, int)

length

public long length()
            throws java.sql.SQLException
Specified by:
length in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.length()

position

public long position(java.sql.Blob pattern,
                     long start)
              throws java.sql.SQLException
Specified by:
position in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.position(java.sql.Blob, long)

position

public long position(byte[] pattern,
                     long start)
              throws java.sql.SQLException
Specified by:
position in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.position(byte[], long)

setBinaryStream

public java.io.OutputStream setBinaryStream(long pos)
                                     throws java.sql.SQLException
Specified by:
setBinaryStream in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.setBinaryStream(long)

setBytes

public int setBytes(long pos,
                    byte[] bytes,
                    int offset,
                    int len)
             throws java.sql.SQLException
Specified by:
setBytes in interface java.sql.Blob
Throws:
java.sql.SQLException
Since:
4.3
See Also:
Blob.setBytes(long, byte[], int, int)

setBytes

public int setBytes(long pos,
                    byte[] bytes)
             throws java.sql.SQLException
Specified by:
setBytes in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.setBytes(long, byte[])

truncate

public void truncate(long len)
              throws java.sql.SQLException
Specified by:
truncate in interface java.sql.Blob
Throws:
java.sql.SQLException
See Also:
Blob.truncate(long)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getByteArray

public static byte[] getByteArray(java.sql.Blob blob)
                           throws java.sql.SQLException,
                                  java.io.IOException
Utility Method to convert blob into byte array

Parameters:
blob -
Returns:
byte array
Throws:
java.sql.SQLException
java.io.IOException

free

public void free()
          throws java.sql.SQLException
Specified by:
free in interface java.sql.Blob
Throws:
java.sql.SQLException

getBinaryStream

public java.io.InputStream getBinaryStream(long pos,
                                           long length)
                                    throws java.sql.SQLException
Specified by:
getBinaryStream in interface java.sql.Blob
Throws:
java.sql.SQLException


Copyright © 2009. All Rights Reserved.