org.openbandy.io.rms
Class RmsRecord

java.lang.Object
  extended by org.openbandy.io.rms.RmsRecord
All Implemented Interfaces:
java.io.DataInput

public class RmsRecord
extends java.lang.Object
implements java.io.DataInput

In order to have a more efficient way to read records all access is encapsulated in this class, hence guaranteeing that: 1. Reuse the raw byte array 2. Reuse the input streams

(c) Copyright P. Bolliger 2007, ALL RIGHTS RESERVED.

Version:
1.0
Author:
Philipp Bolliger (philipp@bolliger.name)

Constructor Summary
RmsRecord(javax.microedition.rms.RecordStore rs)
           
RmsRecord(javax.microedition.rms.RecordStore rs, int initialRecordSize)
           
 
Method Summary
 byte[] getByteArray()
          Return the current record as byte array
 int getLength()
          TODO comment!
 byte[] moveTo(int id)
          Move the access 'pointer' to the index given
 boolean readBoolean()
           
 byte readByte()
           
 char readChar()
           
 double readDouble()
           
 float readFloat()
           
 void readFully(byte[] b)
           
 void readFully(byte[] b, int off, int len)
           
 int readInt()
           
 java.lang.String readLine()
          TODO comment!
 long readLong()
           
 short readShort()
           
 int readUnsignedByte()
           
 int readUnsignedShort()
           
 java.lang.String readUTF()
           
 int skipBytes(int arg0)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RmsRecord

public RmsRecord(javax.microedition.rms.RecordStore rs)

RmsRecord

public RmsRecord(javax.microedition.rms.RecordStore rs,
                 int initialRecordSize)
Method Detail

getByteArray

public byte[] getByteArray()
Return the current record as byte array

Returns:
byte array of data

getLength

public int getLength()
TODO comment!

Returns:

moveTo

public byte[] moveTo(int id)
Move the access 'pointer' to the index given

Parameters:
id - Index of the record store to read from
Returns:
byte array of values stored in this record store

readFully

public void readFully(byte[] b)
Specified by:
readFully in interface java.io.DataInput

readFully

public void readFully(byte[] b,
                      int off,
                      int len)
Specified by:
readFully in interface java.io.DataInput

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Specified by:
readBoolean in interface java.io.DataInput
Throws:
java.io.IOException

readByte

public byte readByte()
Specified by:
readByte in interface java.io.DataInput

readUnsignedByte

public int readUnsignedByte()
Specified by:
readUnsignedByte in interface java.io.DataInput

readShort

public short readShort()
Specified by:
readShort in interface java.io.DataInput

readUnsignedShort

public int readUnsignedShort()
Specified by:
readUnsignedShort in interface java.io.DataInput

readChar

public char readChar()
Specified by:
readChar in interface java.io.DataInput

readInt

public int readInt()
Specified by:
readInt in interface java.io.DataInput

readLong

public long readLong()
Specified by:
readLong in interface java.io.DataInput

readUTF

public java.lang.String readUTF()
Specified by:
readUTF in interface java.io.DataInput

skipBytes

public int skipBytes(int arg0)
Specified by:
skipBytes in interface java.io.DataInput

readFloat

public float readFloat()
Specified by:
readFloat in interface java.io.DataInput

readDouble

public double readDouble()
Specified by:
readDouble in interface java.io.DataInput

readLine

public java.lang.String readLine()
                          throws java.io.IOException
TODO comment!

Specified by:
readLine in interface java.io.DataInput
Returns:
Throws:
java.io.IOException