com.imagero.uio.bio.content
Class Content

java.lang.Object
  extended bycom.imagero.uio.bio.content.Content
Direct Known Subclasses:
ByteArrayContent, CharArrayContent, DoubleArrayContent, DummyContent, FileCachedInputStreamContent, FloatArrayContent, HTTPContent, IntArrayContent, LongArrayContent, MemoryCachedInputStreamContent, RandomAccessFileContent, RandomAccessIOContent, ShortArrayContent, SynchronizedContent

public abstract class Content
extends java.lang.Object


Constructor Summary
Content()
           
 
Method Summary
abstract  boolean canReload()
          Determine if data may be reloaded or not.
abstract  void close()
          close stream
protected  void finalize()
           
abstract  long length()
          Get stream length.
 int load(long offset, byte[] buffer)
          Load stream content to specified buffer
abstract  int load(long offset, int bpos, byte[] buffer)
          Load stream content to specified buffer
abstract  void save(long offset, int bpos, byte[] buffer, int length)
          Save buffer content to stream.
abstract  boolean writable()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Content

public Content()
Method Detail

load

public final int load(long offset,
                      byte[] buffer)
               throws java.io.IOException
Load stream content to specified buffer

Parameters:
offset - stream offset
buffer - byte array
Returns:
how much bytes were loaded
Throws:
java.io.IOException

load

public abstract int load(long offset,
                         int bpos,
                         byte[] buffer)
                  throws java.io.IOException
Load stream content to specified buffer

Parameters:
offset - stream offset
bpos - buffer position
buffer - byte array
Returns:
how much bytes were loaded
Throws:
java.io.IOException

save

public abstract void save(long offset,
                          int bpos,
                          byte[] buffer,
                          int length)
                   throws java.io.IOException
Save buffer content to stream. Not always supported.

Parameters:
offset - stream offset
bpos - buffer position
buffer - byte array
length - how much bytes should be saved
Throws:
java.io.IOException

length

public abstract long length()
                     throws java.io.IOException
Get stream length. Not always known.

Returns:
Throws:
java.io.IOException

close

public abstract void close()
close stream


canReload

public abstract boolean canReload()
Determine if data may be reloaded or not. For example: data from InputStream cannot be reloaded, however if content uses file or memory based cache then it is possible to reload data.

Returns:
true if data can be reloaded.

writable

public abstract boolean writable()

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable