Mobios v0.91

mobios.mckoi.store
Interface Area


public interface Area

An interface that represents an area of a store that has been allocated. The area object maintains a pointer that can be manipulated and read and written to. This interface is modelled on the java.nio.Buffer interface and should be easily interchanged with it.

Author:
Tobias Downer

Method Summary
 int capacity()
          Returns the capacity of the area.
 Area copyTo(Area destination, int size)
          Copies 'size' bytes from the current position of this Area to the destination Area (at the position set in the destination area).
 byte get()
           
 Area get(byte[] buf, int off, int len)
           
 char getChar()
           
 int getInt()
           
 long getLong()
           
 short getShort()
           
 int position()
          Returns the current position of the pointer within the area.
 Area position(int position)
          Sets the position within the area and returns this object.
 Area put(byte b)
           
 Area put(byte[] buf, int off, int len)
           
 Area putChar(char c)
           
 Area putInt(int i)
           
 Area putLong(long l)
           
 Area putShort(short s)
           
 

Method Detail

position

int position()
Returns the current position of the pointer within the area. The position starts at beginning of the area.


capacity

int capacity()
Returns the capacity of the area.


position

Area position(int position)
              throws IOException
Sets the position within the area and returns this object.

Throws:
IOException

copyTo

Area copyTo(Area destination,
            int size)
            throws IOException
Copies 'size' bytes from the current position of this Area to the destination Area (at the position set in the destination area). Returns this area.

Throws:
IOException

get

byte get()
         throws IOException
Throws:
IOException

put

Area put(byte b)
         throws IOException
Throws:
IOException

get

Area get(byte[] buf,
         int off,
         int len)
         throws IOException
Throws:
IOException

put

Area put(byte[] buf,
         int off,
         int len)
         throws IOException
Throws:
IOException

getShort

short getShort()
               throws IOException
Throws:
IOException

putShort

Area putShort(short s)
              throws IOException
Throws:
IOException

getInt

int getInt()
           throws IOException
Throws:
IOException

putInt

Area putInt(int i)
            throws IOException
Throws:
IOException

getLong

long getLong()
             throws IOException
Throws:
IOException

putLong

Area putLong(long l)
             throws IOException
Throws:
IOException

getChar

char getChar()
             throws IOException
Throws:
IOException

putChar

Area putChar(char c)
             throws IOException
Throws:
IOException

Mobios v0.91

(C) 2002 - 2006 The MoBIoS Group