com.imagero.uio.bio.content
Class RandomAccessIOContent

java.lang.Object
  extended bycom.imagero.uio.bio.content.Content
      extended bycom.imagero.uio.bio.content.RandomAccessIOContent

public class RandomAccessIOContent
extends Content

Date: 05.01.2008


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

Constructor Detail

RandomAccessIOContent

public RandomAccessIOContent(RandomAccessIO rio)
                      throws java.io.IOException
Method Detail

load

public int load(long offset,
                int bpos,
                byte[] b)
         throws java.io.IOException
Description copied from class: Content
Load stream content to specified buffer

Specified by:
load in class Content
Parameters:
offset - stream offset
bpos - buffer position
b - byte array
Returns:
how much bytes were loaded
Throws:
java.io.IOException

canReload

public boolean canReload()
Description copied from class: Content
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.

Specified by:
canReload in class Content
Returns:
true if data can be reloaded.

close

public void close()
Description copied from class: Content
close stream

Specified by:
close in class Content

writable

public boolean writable()
Specified by:
writable in class Content

save

public void save(long offset,
                 int bpos,
                 byte[] buffer,
                 int length)
          throws java.io.IOException
Description copied from class: Content
Save buffer content to stream. Not always supported.

Specified by:
save in class Content
Parameters:
offset - stream offset
bpos - buffer position
buffer - byte array
length - how much bytes should be saved
Throws:
java.io.IOException

length

public long length()
            throws java.io.IOException
Description copied from class: Content
Get stream length. Not always known.

Specified by:
length in class Content
Returns:
Throws:
java.io.IOException

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class Content
Throws:
java.lang.Throwable