com.imagero.uio.bio.content
Class SynchronizedContent

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

public class SynchronizedContent
extends Content

Date: 05.01.2008


Constructor Summary
SynchronizedContent(Content content)
           
 
Method Summary
 boolean canReload()
          Determine if data may be reloaded or not.
 void close()
          close stream
 Content getContent()
           
 long length()
          Get stream length.
 int load(long offset, int bpos, byte[] buffer)
          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
finalize, load
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizedContent

public SynchronizedContent(Content content)
Method Detail

load

public int load(long offset,
                int bpos,
                byte[] buffer)
         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
buffer - byte array
Returns:
how much bytes were loaded
Throws:
java.io.IOException

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

close

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

Specified by:
close in class Content

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.

writable

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

getContent

public Content getContent()