com.imagero.uio.blob
Class Blob

java.lang.Object
  extended bycom.imagero.uio.blob.Blob
Direct Known Subclasses:
Blob.BaBlob, Blob.IaBlob, Blob.RoBlob

public abstract class Blob
extends java.lang.Object

Blob - Object which encapsulates (possible deferred) data which may come from different sources.


Nested Class Summary
static class Blob.BaBlob
           
static class Blob.IaBlob
           
static class Blob.RoBlob
           
 
Constructor Summary
Blob()
           
 
Method Summary
abstract  void clear()
          release reloadable resources
protected abstract  long computeLength()
           
abstract  int get(long start, byte[] dest)
          retrieve data from this Blob
abstract  byte[] get(long start, int length)
          retrieve data from this Blob
 java.io.InputStream getInputStream()
           
 long getLength()
           
 java.lang.Object getProperty(java.lang.Object key)
           
protected  boolean lengthKnown()
           
abstract  void set(long start, byte[] data)
          set data (work only if writable returns true)
 void setProperty(java.lang.Object key, java.lang.Object property)
           
abstract  boolean writable()
          determine if this Blob is writable and method set(long, byte[]) can be used to change content of this Blob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Blob

public Blob()
Method Detail

get

public abstract byte[] get(long start,
                           int length)
                    throws java.io.IOException
retrieve data from this Blob

Parameters:
start - start offset
length - how much bytes to get
Returns:
byte array with data
Throws:
java.io.IOException

get

public abstract int get(long start,
                        byte[] dest)
                 throws java.io.IOException
retrieve data from this Blob

Parameters:
start - start offset
dest - where to copy data
Returns:
how much byte were copied
Throws:
java.io.IOException

writable

public abstract boolean writable()
determine if this Blob is writable and method set(long, byte[]) can be used to change content of this Blob

Returns:
true if Blob is writable

set

public abstract void set(long start,
                         byte[] data)
                  throws java.io.IOException
set data (work only if writable returns true)

Parameters:
start - start in destination
data - new data
Throws:
java.io.IOException

clear

public abstract void clear()
release reloadable resources


lengthKnown

protected boolean lengthKnown()

computeLength

protected abstract long computeLength()
                               throws java.io.IOException
Throws:
java.io.IOException

getLength

public long getLength()

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Throws:
java.io.IOException

getProperty

public java.lang.Object getProperty(java.lang.Object key)

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object property)