Methods Summary |
---|
static int | calculateBlockSize(int dataSize)A convenience method for calculating the block size given the data size.
final int block_header_size = AbstractRecordStoreImpl.BLOCK_HEADER_SIZE;
int remainder = dataSize % block_header_size; // & 0x07;
if (remainder == 0) {
return dataSize + block_header_size;
} else {
return dataSize + (block_header_size - remainder) +
block_header_size;
}
|
static native void | deleteFile(int suiteId, java.lang.String name, int extension)Removes the storage file for record store filename
if it exists.
|
static native boolean | exists(int suiteId, java.lang.String name, int extension)Looks to see if the storage file for record store
identified by uidPath exists
|
static int | getInt(byte[] data, int offset)A convenience method for converting a byte array into
an int (assumes big-endian byte ordering).
int r = data[offset++];
r = (r << 8) | ((int)(data[offset++]) & 0xff);
r = (r << 8) | ((int)(data[offset++]) & 0xff);
r = (r << 8) | ((int)(data[offset++]) & 0xff);
return r;
|
static long | getLong(byte[] data, int offset)A convenience method for converting a byte array into
a long (assumes big-endian byte ordering).
long r = data[offset++];
r = (r << 8) | ((long)(data[offset++]) & 0xff);
r = (r << 8) | ((long)(data[offset++]) & 0xff);
r = (r << 8) | ((long)(data[offset++]) & 0xff);
r = (r << 8) | ((long)(data[offset++]) & 0xff);
r = (r << 8) | ((long)(data[offset++]) & 0xff);
r = (r << 8) | ((long)(data[offset++]) & 0xff);
r = (r << 8) | ((long)(data[offset++]) & 0xff);
return r;
|
static int | putInt(int i, byte[] data, int offset)A convenience method for converting an integer into
a byte array.
data[offset++] = (byte)((i >> 24) & 0xff);
data[offset++] = (byte)((i >> 16) & 0xff);
data[offset++] = (byte)((i >> 8) & 0xff);
data[offset] = (byte)(i & 0xff);
return 4;
|
static int | putLong(long l, byte[] data, int offset)A convenience method for converting a long into
a byte array.
data[offset++] = (byte)((l >> 56) & 0xff);
data[offset++] = (byte)((l >> 48) & 0xff);
data[offset++] = (byte)((l >> 40) & 0xff);
data[offset++] = (byte)((l >> 32) & 0xff);
data[offset++] = (byte)((l >> 24) & 0xff);
data[offset++] = (byte)((l >> 16) & 0xff);
data[offset++] = (byte)((l >> 8) & 0xff);
data[offset] = (byte)(l & 0xff);
return 8;
|
static boolean | quietDeleteFile(int suiteId, java.lang.String name, int extension)Removes record store file without throwing an exception on failure.
try {
deleteFile(suiteId, name, extension);
} catch (Throwable t) {
return false;
}
return true;
|