Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.imagero.uio.buffer
Class RAFBufferManager  view RAFBufferManager download RAFBufferManager.java

java.lang.Object
  extended bycom.imagero.uio.buffer.AbstractBufferManager
      extended bycom.imagero.uio.buffer.RAFBufferManager
All Implemented Interfaces:
BufferManager
Direct Known Subclasses:
MutableRAFBufferManager

public class RAFBufferManager
extends AbstractBufferManager


Field Summary
(package private)  java.lang.Integer maxKey
           
protected  java.io.RandomAccessFile raf
           
 
Fields inherited from class com.imagero.uio.buffer.AbstractBufferManager
accessManager, bufferSize, defaultBufferSize, length, offset, ro
 
Fields inherited from interface com.imagero.uio.buffer.BufferManager
empty
 
Constructor Summary
RAFBufferManager(java.io.RandomAccessFile raf)
           
RAFBufferManager(java.io.RandomAccessFile raf, long offset)
           
RAFBufferManager(java.io.RandomAccessFile raf, long offset, long length)
          create MutableBuffer for RandomAccessRO (with standard Buffer length of 50k)
RAFBufferManager(java.io.RandomAccessFile raf, long offset, long length, int dsLength)
          create MutableBuffer for RandomAccessRO
 
Method Summary
 void clear()
          clear all buffered data without closing
 void close()
          Allows to free all possibly used resources
protected  Buffer createBuffer(java.io.RandomAccessFile raf, long offset, int dsLength)
           
 byte[] getData(int i)
          get data (as byte array) from i'th Buffer
protected  byte[] getDataImpl(int i)
          read 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
I assume here that length of each Buffer (except last one) equals to dsLength
 int getIndex(long pos)
          get index of Buffer which contains pos
 long getLength()
          get length of data
 
Methods inherited from class com.imagero.uio.buffer.AbstractBufferManager
clear, clearImpl, createAccessManager, flush, getCount, getDefaultBufferSize, getEnd, getMaxCache, getStart, setDefaultBufferSize, setDirty, setDirty, setMaxCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

raf

protected java.io.RandomAccessFile raf

maxKey

java.lang.Integer maxKey
Constructor Detail

RAFBufferManager

public RAFBufferManager(java.io.RandomAccessFile raf)
                 throws java.io.IOException

RAFBufferManager

public RAFBufferManager(java.io.RandomAccessFile raf,
                        long offset)
                 throws java.io.IOException

RAFBufferManager

public RAFBufferManager(java.io.RandomAccessFile raf,
                        long offset,
                        long length)
create MutableBuffer for RandomAccessRO (with standard Buffer length of 50k)


RAFBufferManager

public RAFBufferManager(java.io.RandomAccessFile raf,
                        long offset,
                        long length,
                        int dsLength)
create MutableBuffer for RandomAccessRO

Method Detail

createBuffer

protected Buffer createBuffer(java.io.RandomAccessFile raf,
                              long offset,
                              int dsLength)

getData

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


getDataImpl

protected byte[] getDataImpl(int i)
                      throws java.io.IOException
read i'th Buffer


getDataLength

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


getIndex

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


getLength

public long getLength()
get length of data


getDataStart

public long getDataStart(int i)
get start of i'th Buffer in byte
I assume here that length of each Buffer (except last one) equals to dsLength


close

public void close()
Description copied from interface: BufferManager
Allows to free all possibly used resources


clear

public void clear()
Description copied from interface: BufferManager
clear all buffered data without closing

Specified by:
clear in interface BufferManager
Overrides:
clear in class AbstractBufferManager