com.imagero.uio.buffer.arrays
Class ShortArrayBufferManager

java.lang.Object
  extended bycom.imagero.uio.buffer.arrays.AbstractArrayBufferManager
      extended bycom.imagero.uio.buffer.arrays.ShortArrayBufferManager
All Implemented Interfaces:
BufferManager, MutableBufferManager

public class ShortArrayBufferManager
extends AbstractArrayBufferManager

Gives possibility to read and write a short array using RandomAccess interface


Field Summary
 
Fields inherited from class com.imagero.uio.buffer.arrays.AbstractArrayBufferManager
TILE_SIZE, unitSize
 
Fields inherited from interface com.imagero.uio.buffer.BufferManager
empty
 
Constructor Summary
ShortArrayBufferManager(short[] data)
          Create ShortArrayBufferManager with standard tile size
ShortArrayBufferManager(short[] data, int size)
           
ShortArrayBufferManager(short[] data, int offset, int length)
           
ShortArrayBufferManager(short[] data, int offset, int length, int size)
           
 
Method Summary
protected  int readUnitBE(int offset, byte[] dest, int destOffset)
          read unit (short) in BIG_ENDIAN order
protected  int readUnitLE(int offset, byte[] dest, int destOffset)
          read appropriate unit (short) in LITTLE_ENDIAN order
protected  int writeUnitBE(byte[] source, int sourceOffset, int destOffset)
          write appropriate unit (int) in BIG_ENDIAN order
protected  int writeUnitLE(byte[] source, int sourceOffset, int destOffset)
          write appropriate unit (int) in LITTLE_ENDIAN order
 
Methods inherited from class com.imagero.uio.buffer.arrays.AbstractArrayBufferManager
clear, clear, close, flush, flush, getByteOrder, getCount, getData, getDataLength, getDataStart, getIndex, getLength, getMaxCache, getUnitSize, read, readBE, readLE, setByteOrder, setDirty, setDirty, setMaxCache, write, writeBE, writeLE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShortArrayBufferManager

public ShortArrayBufferManager(short[] data)
Create ShortArrayBufferManager with standard tile size

Parameters:
data - int array

ShortArrayBufferManager

public ShortArrayBufferManager(short[] data,
                               int size)
Parameters:
data - int array
size - tile length (for Buffer)

ShortArrayBufferManager

public ShortArrayBufferManager(short[] data,
                               int offset,
                               int length)
Parameters:
data - int array
offset - start offset in data
length - length to read

ShortArrayBufferManager

public ShortArrayBufferManager(short[] data,
                               int offset,
                               int length,
                               int size)
Parameters:
data - int array
offset - start offset in data
length - length to read
size - tile length (for Buffer)
Method Detail

writeUnitLE

protected int writeUnitLE(byte[] source,
                          int sourceOffset,
                          int destOffset)
write appropriate unit (int) in LITTLE_ENDIAN order

Specified by:
writeUnitLE in class AbstractArrayBufferManager
Parameters:
source - source byte array
sourceOffset - offset in source array
destOffset - offset in destination array
Returns:
new offset in source array (for next writeUnitXX)

writeUnitBE

protected int writeUnitBE(byte[] source,
                          int sourceOffset,
                          int destOffset)
write appropriate unit (int) in BIG_ENDIAN order

Specified by:
writeUnitBE in class AbstractArrayBufferManager
Parameters:
source - source byte array
sourceOffset - offset in source array
destOffset - offset in destination array
Returns:
new offset in source array (for next writeUnitXX)

readUnitBE

protected int readUnitBE(int offset,
                         byte[] dest,
                         int destOffset)
read unit (short) in BIG_ENDIAN order

Specified by:
readUnitBE in class AbstractArrayBufferManager
Parameters:
offset - offset in source array
dest - byte array (destination)
destOffset - offset in destination array
Returns:
offset in destination array (updated)

readUnitLE

protected int readUnitLE(int offset,
                         byte[] dest,
                         int destOffset)
read appropriate unit (short) in LITTLE_ENDIAN order

Specified by:
readUnitLE in class AbstractArrayBufferManager
Parameters:
offset - offset in source array
dest - byte array (destination)
destOffset - offset in destination array
Returns:
offset in destination array (updated)