|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.imagero.uio.buffer.arrays.AbstractArrayBufferManager
Field Summary | |
protected static int |
TILE_SIZE
|
protected int |
unitSize
|
Fields inherited from interface com.imagero.uio.buffer.BufferManager |
empty |
Constructor Summary | |
AbstractArrayBufferManager()
|
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()
write back dirty data and free resources |
void |
flush()
write changed data back (if cached) |
void |
flush(boolean free)
write back dirty data and possibly free resources |
int |
getByteOrder()
|
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 |
int |
getMaxCache()
get max buffer count |
int |
getUnitSize()
get unit size |
protected void |
read(byte[] b,
int index)
read block of data into byte array. |
protected void |
readBE(byte[] b,
int index)
read block of data into byte array |
protected void |
readLE(byte[] b,
int index)
read block of data into byte array |
protected abstract int |
readUnitBE(int offset,
byte[] dest,
int destOffset)
read appropriate unit (short, int or long) in BIG_ENDIAN order |
protected abstract int |
readUnitLE(int offset,
byte[] dest,
int destOffset)
read appropriate unit (short, int or long) in LITTLE_ENDIAN order |
void |
setByteOrder(int byteOrder)
|
void |
setDirty(int index)
mark Buffer as dirty (changed) |
void |
setDirty(long from,
long to)
mark region as dirty (changed) |
void |
setMaxCache(int max)
set max buffer count |
protected void |
write(byte[] b,
int index)
write block of data back to int array |
protected void |
writeBE(byte[] b,
int index)
|
protected void |
writeLE(byte[] b,
int index)
|
protected abstract int |
writeUnitBE(byte[] b,
int c,
int offset)
|
protected abstract int |
writeUnitLE(byte[] b,
int c,
int offset)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int unitSize
protected static int TILE_SIZE
Constructor Detail |
public AbstractArrayBufferManager()
Method Detail |
protected void readLE(byte[] b, int index)
b
- byte arrayindex
- index of Buffer to readpublic long getDataStart(int i)
BufferManager
getDataStart
in interface BufferManager
i
- Buffer index
n-1 |
||
dataStart(n) = | Σ | getDataLength(i) |
i=0 |
public int getIndex(long pos)
BufferManager
pos
getIndex
in interface BufferManager
pos
- public void setDirty(long from, long to)
setDirty
in interface MutableBufferManager
from
- start of changed regionto
- end of changed regionpublic void setDirty(int index)
setDirty
in interface MutableBufferManager
index
- Buffer to mark as dirtypublic void flush()
MutableBufferManager
flush
in interface MutableBufferManager
protected void readBE(byte[] b, int index)
b
- byte arrayindex
- tile index to readprotected abstract int readUnitBE(int offset, byte[] dest, int destOffset)
offset
- offset in source arraydest
- byte array (destination)destOffset
- offset in destination array
protected abstract int readUnitLE(int offset, byte[] dest, int destOffset)
offset
- offset in source arraydest
- byte array (destination)destOffset
- offset in destination array
public int getCount()
BufferManager
getCount
in interface BufferManager
public int getDataLength(int i)
getDataLength
in interface BufferManager
i
- Buffer index
protected void read(byte[] b, int index)
b
- byte arrayindex
- index of Buffer to readpublic byte[] getData(int i) throws java.io.IOException
BufferManager
getData
in interface BufferManager
i
- Buffer index
java.io.IOException
protected void write(byte[] b, int index)
b
- data to writeindex
- tile index to writepublic void flush(boolean free)
free
- if true free resourcespublic void close()
close
in interface BufferManager
public void clear()
BufferManager
clear
in interface BufferManager
public void clear(long start, long end)
BufferManager
clear
in interface BufferManager
protected void writeLE(byte[] b, int index)
protected abstract int writeUnitLE(byte[] b, int c, int offset)
protected void writeBE(byte[] b, int index)
protected abstract int writeUnitBE(byte[] b, int c, int offset)
public long getLength()
getLength
in interface BufferManager
public int getUnitSize()
public int getByteOrder()
public void setByteOrder(int byteOrder)
public int getMaxCache()
BufferManager
getMaxCache
in interface BufferManager
public void setMaxCache(int max)
BufferManager
setMaxCache
in interface BufferManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |