com.imagero.uio.buffer
Interface BufferManager

All Known Subinterfaces:
MutableBufferManager
All Known Implementing Classes:
AbstractArrayBufferManager, AbstractBufferManager, DefaultBufferManager, MutableRABufferManager, MutableRAFBufferManager, OutputStreamBufferManager

public interface BufferManager

BufferManager.java


Field Summary
static byte[] empty
           
 
Method Summary
 void clear()
          clear all buffered data without closing
 void clear(long start, long end)
          all buffered data in stream between start and end will be cleared
 void close()
          Allows to free all possibly used resources
 int getCount()
          Get count of Buffer objects in this BufferManager
 byte[] getData(int i)
          Get data (as byte array) from i'th Buffer
 int getDataLength(int i)
          Get length of i'th Buffer
 long getDataStart(int i)
          get start of i'th Buffer in byte
 int getIndex(long pos)
          Get index of Buffer which contains pos
 long getLength()
          Get length of data of all Buffer together
 int getMaxCache()
          get max buffer count
 void setMaxCache(int max)
          set max buffer count
 

Field Detail

empty

public static final byte[] empty
Method Detail

getData

public byte[] getData(int i)
               throws java.io.IOException
Get data (as byte array) from i'th Buffer

Parameters:
i - Buffer index
Returns:
byte array
Throws:
java.io.IOException

getCount

public int getCount()
Get count of Buffer objects in this BufferManager

Returns:
int

getDataLength

public int getDataLength(int i)
Get length of i'th Buffer

Parameters:
i - Buffer index
Returns:
int

getIndex

public int getIndex(long pos)
Get index of Buffer which contains pos

Parameters:
pos -

getLength

public long getLength()
Get length of data of all Buffer together


close

public void close()
Allows to free all possibly used resources


getDataStart

public long getDataStart(int i)
get start of i'th Buffer in byte

Parameters:
i - Buffer index
Returns:
int
                          n-1
dataStart(n) = Σ getDataLength(i)
                          i=0

clear

public void clear()
clear all buffered data without closing


getMaxCache

public int getMaxCache()
get max buffer count

Returns:
max buffer count

setMaxCache

public void setMaxCache(int max)
set max buffer count


clear

public void clear(long start,
                  long end)
           throws java.io.IOException
all buffered data in stream between start and end will be cleared

Throws:
java.io.IOException