| java.lang.Object com.sun.midp.rms.RecordStoreUtil
RecordStoreUtil | public class RecordStoreUtil (Code) | | A class implementing record store utility functions.
|
Method Summary | |
static int | calculateBlockSize(int dataSize) A convenience method for calculating the block size given the data size.
Parameters: dataSize - the size of the data in the block. | native static void | deleteFile(int suiteId, String name, int extension) Removes the storage file for record store filename
if it exists. | native static boolean | exists(int suiteId, String name, int extension) | static int | getInt(byte[] data, int offset) A convenience method for converting a byte array into
an int (assumes big-endian byte ordering).
Parameters: data - the byte array returned from the database. Parameters: offset - the offset into the array of the first byte to start from. | static long | getLong(byte[] data, int offset) A convenience method for converting a byte array into
a long (assumes big-endian byte ordering).
Parameters: data - the byte array returned from the database. Parameters: offset - the offset into the array of the first byte to start from. | static int | putInt(int i, byte[] data, int offset) A convenience method for converting an integer into
a byte array.
Parameters: i - the integer to turn into a byte array. Parameters: data - a place to store the bytes of i . Parameters: offset - starting point within data tostore i . | static int | putLong(long l, byte[] data, int offset) A convenience method for converting a long into
a byte array.
Parameters: l - the long to turn into a byte array. Parameters: data - a place to store the bytes of l . Parameters: offset - Starting point within data tostore l . | static boolean | quietDeleteFile(int suiteId, String name, int extension) Removes record store file without throwing an exception on failure. |
calculateBlockSize | static int calculateBlockSize(int dataSize)(Code) | | A convenience method for calculating the block size given the data size.
Parameters: dataSize - the size of the data in the block. an int corresponding to the size of the block padded toa multiple of the BLOCK HEADER SIZE. |
deleteFile | native static void deleteFile(int suiteId, String name, int extension) throws RecordStoreException(Code) | | Removes the storage file for record store filename
if it exists.
Parameters: suiteId - ID of the MIDlet suite that owns the record store Parameters: name - name of the record store Parameters: extension - the extension for the record store file throws: RecordStoreException - if deletion encountered an errorinternally. |
exists | native static boolean exists(int suiteId, String name, int extension)(Code) | | Looks to see if the storage file for record store
identified by uidPath exists
Parameters: suiteId - ID of the MIDlet suite that owns the record store Parameters: name - name of the record store Parameters: extension - the extension for the record store file true if the file exists, false if it does not. |
getInt | static int getInt(byte[] data, int offset)(Code) | | A convenience method for converting a byte array into
an int (assumes big-endian byte ordering).
Parameters: data - the byte array returned from the database. Parameters: offset - the offset into the array of the first byte to start from. an int corresponding to the first four bytesof the array passed in. |
getLong | static long getLong(byte[] data, int offset)(Code) | | A convenience method for converting a byte array into
a long (assumes big-endian byte ordering).
Parameters: data - the byte array returned from the database. Parameters: offset - the offset into the array of the first byte to start from. a long corresponding to the first eight bytesof the array passed in. |
putInt | static int putInt(int i, byte[] data, int offset)(Code) | | A convenience method for converting an integer into
a byte array.
Parameters: i - the integer to turn into a byte array. Parameters: data - a place to store the bytes of i . Parameters: offset - starting point within data tostore i . the number of bytes written to the array. |
putLong | static int putLong(long l, byte[] data, int offset)(Code) | | A convenience method for converting a long into
a byte array.
Parameters: l - the long to turn into a byte array. Parameters: data - a place to store the bytes of l . Parameters: offset - Starting point within data tostore l . the number of bytes written to the array. |
quietDeleteFile | static boolean quietDeleteFile(int suiteId, String name, int extension)(Code) | | Removes record store file without throwing an exception on failure.
Parameters: suiteId - ID of the MIDlet suite that owns the record store Parameters: name - name of the record store Parameters: extension - the extension for the record store file true if file was found and deleted successfully,false otherwise. |
|
|