es.prodevelop.gvsig.mobile.fmap.util.bytebuffer
Class FalseByteBuffer

java.lang.Object
  extended byes.prodevelop.gvsig.mobile.fmap.util.bytebuffer.FalseByteBuffer

public class FalseByteBuffer
extends java.lang.Object

This class replaces the byte buffer used in J2SE to store a file in memory.

Author:
jldominguez
See Also:
ByteOrder

Constructor Summary
FalseByteBuffer(byte[] bb)
          Constructor
 
Method Summary
 byte getByte()
           
 byte getByte(int ind)
          Gets one byte
 void getBytes(byte[] out)
          Gets some bytes.
 double getDouble()
           
 int getInt()
           
 int getInt(int index)
          Gets the integer at a certain position
 int getPosition()
           
 short getShort()
           
 void position(int p)
          Moves file cursor to position p
 void setByteOrder(java.nio.ByteOrder o)
          Sets byte order (big endian, little endian)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FalseByteBuffer

public FalseByteBuffer(byte[] bb)
Constructor

Parameters:
bb - array of bytes to be stored
Method Detail

position

public void position(int p)
Moves file cursor to position p

Parameters:
p - the new position

getPosition

public int getPosition()
Returns:
current cursor position

getByte

public byte getByte()
Returns:
byte pointed by cursor then increases cursor

getByte

public byte getByte(int ind)
Gets one byte

Parameters:
ind - index of the byte of interest
Returns:
the byte of interest

getInt

public int getInt()
Returns:
integer pointed by cursor then increases cursor

getShort

public short getShort()
Returns:
short pointed by cursor then increases cursor

getInt

public int getInt(int index)
Gets the integer at a certain position

Parameters:
index - the index of interest
Returns:
the integer at a certain position

getBytes

public void getBytes(byte[] out)
Gets some bytes.

Parameters:
out - the array of bytes to be filled

getDouble

public double getDouble()
Returns:
double pointed by cursor then increases cursor

setByteOrder

public void setByteOrder(java.nio.ByteOrder o)
Sets byte order (big endian, little endian)

Parameters:
o - byte order (big endian, little endian)