public final class SqlJetUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static ISqlJetMemoryManager |
memoryManager |
static java.lang.String |
SQLJET_PACKAGENAME |
Constructor and Description |
---|
SqlJetUtility() |
Modifier and Type | Method and Description |
---|---|
static long |
absolute(long i)
Returns absolute value of argument
|
static java.lang.Object[] |
addArrays(java.lang.Object[] array1,
java.lang.Object[] array2) |
static byte[] |
addZeroByteEnd(byte[] b) |
static java.lang.Object |
adjustNumberType(java.lang.Object value) |
static java.lang.Object[] |
adjustNumberTypes(java.lang.Object[] key) |
static SqlJetScope |
adjustScopeNumberTypes(SqlJetScope scope) |
static ISqlJetMemoryPointer |
allocatePtr(int size) |
static ISqlJetMemoryPointer |
allocatePtr(int size,
SqlJetMemoryBufferType bufferType) |
static double |
atof(ISqlJetMemoryPointer z) |
static java.lang.Long |
atoi64(java.lang.String str) |
static boolean |
bitSetTest(java.util.BitSet bitSet,
int index)
Check to see if the i-th bit is set.
|
static java.lang.Object[] |
copyArray(java.lang.Object[] array) |
static java.lang.Long |
doubleToInt64(java.lang.Double r) |
static ISqlJetMemoryPointer |
fromByteBuffer(java.nio.ByteBuffer b) |
static ISqlJetMemoryPointer |
fromString(java.lang.String s,
SqlJetEncoding enc)
Get
ByteBuffer from String . |
static short |
fromUnsigned(int value) |
static int |
fromUnsigned(long value) |
static byte |
fromUnsigned(short value) |
static int |
get2byte(ISqlJetMemoryPointer x)
Read a two-byte big-endian integer values.
|
static int |
get2byte(ISqlJetMemoryPointer x,
int off)
Read a two-byte big-endian integer values.
|
static int |
get4byte(ISqlJetMemoryPointer p)
Read a four-byte big-endian integer value.
|
static int |
get4byte(ISqlJetMemoryPointer p,
int pos)
Read a four-byte big-endian integer value.
|
static long |
get4byteUnsigned(byte[] p)
Read a four-byte big-endian integer value.
|
static long |
get4byteUnsigned(byte[] p,
int pos)
Read a four-byte big-endian integer value.
|
static long |
get4byteUnsigned(ISqlJetMemoryPointer p)
Read a four-byte big-endian integer value.
|
static long |
get4byteUnsigned(ISqlJetMemoryPointer p,
int pos)
Read a four-byte big-endian integer value.
|
static boolean |
getBoolSysProp(java.lang.String propName,
boolean defValue) |
static byte[] |
getBytes(java.lang.String string) |
static <T extends java.lang.Enum<T>> |
getEnumSysProp(java.lang.String propName,
T defValue) |
static int |
getIntSysProp(java.lang.String propName,
int defValue) |
static ISqlJetMemoryPointer |
getMoved(ISqlJetMemoryPointer preceding,
ISqlJetMemoryPointer ptr,
int offset) |
static java.lang.String |
getSysProp(java.lang.String propName,
java.lang.String defValue) |
static int |
getUnsignedByte(ISqlJetMemoryPointer byteBuffer,
int index)
Get unsigned byte from byte buffer
|
static byte |
getVarint(ISqlJetMemoryPointer p,
int offset,
long[] v) |
static byte |
getVarint(ISqlJetMemoryPointer p,
long[] v)
Read a 64-bit variable-length integer from memory starting at p[0].
|
static byte |
getVarint32(ISqlJetMemoryPointer p,
int[] v)
Read a 32-bit variable-length integer from memory starting at p[0].
|
static byte |
getVarint32(ISqlJetMemoryPointer p,
int offset,
int[] v) |
static java.lang.Object[] |
insertArray(java.lang.Object[] intoArray,
java.lang.Object[] insertArray,
int pos) |
static boolean |
isNumber(java.lang.String s,
boolean[] realnum)
Return TRUE if z is a pure numeric string.
|
static void |
log(java.util.logging.Logger logger,
java.lang.String format,
java.lang.Object... args) |
static int |
memcmp(byte[] a1,
byte[] a2,
int count) |
static int |
memcmp(byte[] a1,
int from1,
byte[] a2,
int from2,
int count) |
static int |
memcmp(ISqlJetMemoryPointer a1,
int a1offs,
ISqlJetMemoryPointer a2,
int a2offs,
int count) |
static int |
memcmp(ISqlJetMemoryPointer a1,
ISqlJetMemoryPointer a2,
int count) |
static void |
memcpy(byte[] dest,
byte[] src,
int length) |
static void |
memcpy(byte[] dest,
int dstPos,
byte[] src,
int srcPos,
int length) |
static void |
memcpy(ISqlJetMemoryPointer dest,
int dstPos,
ISqlJetMemoryPointer src,
int srcPos,
int length) |
static void |
memcpy(ISqlJetMemoryPointer dest,
ISqlJetMemoryPointer src,
int length) |
static void |
memcpy(SqlJetCloneable[] dest,
SqlJetCloneable[] src,
int length) |
static <T extends SqlJetCloneable> |
memcpy(T src) |
static void |
memmove(ISqlJetMemoryPointer dst,
int dstOffs,
ISqlJetMemoryPointer src,
int srcOffs,
int n) |
static void |
memmove(ISqlJetMemoryPointer dst,
ISqlJetMemoryPointer src,
int n) |
static void |
memset(ISqlJetMemoryPointer data,
byte value) |
static void |
memset(ISqlJetMemoryPointer data,
byte value,
int count) |
static void |
memset(ISqlJetMemoryPointer data,
int from,
byte value,
int count) |
static void |
movePtr(ISqlJetMemoryPointer p,
int pos) |
static boolean |
mutex_held(ISqlJetMutex mutex) |
static <E extends java.lang.Enum<E>> |
noneOf(java.lang.Class<E> elementType) |
static <E extends java.lang.Enum<E>> |
of(E e) |
static <E extends java.lang.Enum<E>> |
of(E e1,
E... e) |
static <E extends java.lang.Enum<E>> |
of(E e1,
E e2) |
static <E extends java.lang.Enum<E>> |
of(E e1,
E e2,
E e3) |
static ISqlJetMemoryPointer |
pointer(ISqlJetMemoryPointer p) |
static ISqlJetMemoryPointer |
pointer(ISqlJetMemoryPointer p,
int pos)
Implements address arithmetic on byte buffer.
|
static void |
put2byte(ISqlJetMemoryPointer p,
int v)
Write a two-byte big-endian integer values.
|
static void |
put2byte(ISqlJetMemoryPointer p,
int off,
int v)
Write a two-byte big-endian integer values.
|
static ISqlJetMemoryPointer |
put4byte(int v)
Write a four-byte big-endian integer value.
|
static void |
put4byte(ISqlJetMemoryPointer p,
int pos,
long v)
Write a four-byte big-endian integer value.
|
static void |
put4byte(ISqlJetMemoryPointer p,
long v)
Write a four-byte big-endian integer value.
|
static void |
put4byteUnsigned(byte[] p,
int pos,
long v)
Write a four-byte big-endian integer value.
|
static void |
put4byteUnsigned(ISqlJetMemoryPointer p,
int pos,
long v)
Write a four-byte big-endian integer value.
|
static void |
put4byteUnsigned(ISqlJetMemoryPointer p,
long v)
Write a four-byte big-endian integer value.
|
static ISqlJetMemoryPointer |
put4byteUnsigned(long v)
Write a four-byte big-endian integer value.
|
static ISqlJetMemoryPointer |
putUnsignedByte(ISqlJetMemoryPointer byteBuffer,
int index,
int value)
Put unsigned byte to byte buffer
|
static int |
putVarint(ISqlJetMemoryPointer p,
long v)
Write a 64-bit variable-length integer to memory starting at p[0].
|
static int |
putVarint32(ISqlJetMemoryPointer p,
int v)
This routine is a faster version of sqlite3PutVarint() that only works
for 32-bit positive integers and which is optimized for the common case
of small integers.
|
static byte[] |
readByteBuffer(ISqlJetMemoryPointer buffer) |
static int |
sqlite3VarintLen(long v)
Return the number of bytes that will be needed to store the given 64-bit
integer.
|
static ISqlJetMemoryPointer |
streamToBuffer(java.io.InputStream stream) |
static int |
strlen(byte[] s,
int from) |
static int |
strlen(ISqlJetMemoryPointer s,
int from) |
static int |
strlen30(ISqlJetMemoryPointer z)
Compute a string length that is limited to what can be stored in lower 30
bits of a 32-bit signed integer.
|
static java.lang.String |
toString(ISqlJetMemoryPointer buf)
Convert byte buffer to string.
|
static java.lang.String |
toString(ISqlJetMemoryPointer buf,
SqlJetEncoding enc)
Convert byte buffer to string.
|
static short |
toUnsigned(byte value) |
static long |
toUnsigned(int value) |
static int |
toUnsigned(short value) |
static ISqlJetMemoryPointer |
translate(ISqlJetMemoryPointer buf,
SqlJetEncoding from,
SqlJetEncoding to)
Translate
ByteBuffer from one charset to other charset. |
static java.lang.String |
trim(java.lang.String s) |
static int |
varintLen(long v)
Return the number of bytes that will be needed to store the given 64-bit
integer.
|
static ISqlJetMemoryPointer |
wrapPtr(byte[] bs) |
public static final java.lang.String SQLJET_PACKAGENAME
public static final ISqlJetMemoryManager memoryManager
public static void log(java.util.logging.Logger logger, java.lang.String format, java.lang.Object... args)
logger
- format
- args
- public static final ISqlJetMemoryPointer allocatePtr(int size)
public static final ISqlJetMemoryPointer allocatePtr(int size, SqlJetMemoryBufferType bufferType)
public static final ISqlJetMemoryPointer pointer(ISqlJetMemoryPointer p)
buf
- public static final ISqlJetMemoryPointer pointer(ISqlJetMemoryPointer p, int pos)
p
- pos
- public static final void movePtr(ISqlJetMemoryPointer p, int pos)
public static final ISqlJetMemoryPointer wrapPtr(byte[] bs)
bs
- public static java.lang.String getSysProp(java.lang.String propName, java.lang.String defValue) throws SqlJetError
SqlJetError
public static int getIntSysProp(java.lang.String propName, int defValue) throws SqlJetError
SqlJetError
public static boolean getBoolSysProp(java.lang.String propName, boolean defValue)
string
- b
- public static <T extends java.lang.Enum<T>> T getEnumSysProp(java.lang.String propName, T defValue)
T
- propName
- defValue
- public static final int get2byte(ISqlJetMemoryPointer x)
public static final int get2byte(ISqlJetMemoryPointer x, int off)
public static final void put2byte(ISqlJetMemoryPointer p, int v)
public static final void put2byte(ISqlJetMemoryPointer p, int off, int v)
public static final ISqlJetMemoryPointer put4byte(int v)
public static final int get4byte(ISqlJetMemoryPointer p)
public static final int get4byte(ISqlJetMemoryPointer p, int pos)
public static final void put4byte(ISqlJetMemoryPointer p, int pos, long v)
public static final void put4byte(ISqlJetMemoryPointer p, long v)
public static final void memcpy(byte[] dest, byte[] src, int length)
dest
- src
- length
- public static final void memcpy(byte[] dest, int dstPos, byte[] src, int srcPos, int length)
public static final void memcpy(ISqlJetMemoryPointer dest, ISqlJetMemoryPointer src, int length)
public static final void memcpy(ISqlJetMemoryPointer dest, int dstPos, ISqlJetMemoryPointer src, int srcPos, int length)
public static final void memcpy(SqlJetCloneable[] dest, SqlJetCloneable[] src, int length) throws SqlJetException
SqlJetException
public static final <T extends SqlJetCloneable> T memcpy(T src) throws SqlJetException
SqlJetException
public static final void memset(ISqlJetMemoryPointer data, int from, byte value, int count)
data
- from
- value
- count
- public static final void memset(ISqlJetMemoryPointer data, byte value, int count)
data
- value
- count
- public static final void memset(ISqlJetMemoryPointer data, byte value)
data
- value
- public static int strlen(byte[] s, int from)
s
- from
- public static int strlen(ISqlJetMemoryPointer s, int from)
public static boolean bitSetTest(java.util.BitSet bitSet, int index)
bitSet
- index
- public static final int memcmp(byte[] a1, byte[] a2, int count)
magic
- journalMagic
- i
- public static final int memcmp(byte[] a1, int from1, byte[] a2, int from2, int count)
public static final int memcmp(ISqlJetMemoryPointer a1, ISqlJetMemoryPointer a2, int count)
z
- z2
- count
- public static final int memcmp(ISqlJetMemoryPointer a1, int a1offs, ISqlJetMemoryPointer a2, int a2offs, int count)
z
- z2
- count
- public static byte[] addZeroByteEnd(byte[] b)
b
- public static byte[] getBytes(java.lang.String string)
sqliteFileHeader
- public static int putVarint(ISqlJetMemoryPointer p, long v)
public static int putVarint32(ISqlJetMemoryPointer p, int v)
public static byte getVarint(ISqlJetMemoryPointer p, long[] v)
public static byte getVarint(ISqlJetMemoryPointer p, int offset, long[] v)
public static byte getVarint32(ISqlJetMemoryPointer p, int[] v)
SqlJetExceptionRemove
public static byte getVarint32(ISqlJetMemoryPointer p, int offset, int[] v)
public static int sqlite3VarintLen(long v)
public static final boolean mutex_held(ISqlJetMutex mutex)
mutex
- public static int strlen30(ISqlJetMemoryPointer z)
z
- public static final int getUnsignedByte(ISqlJetMemoryPointer byteBuffer, int index)
byteBuffer
- index
- public static final ISqlJetMemoryPointer putUnsignedByte(ISqlJetMemoryPointer byteBuffer, int index, int value)
byteBuffer
- index
- value
- public static java.lang.String toString(ISqlJetMemoryPointer buf)
buf
- public static java.lang.String toString(ISqlJetMemoryPointer buf, SqlJetEncoding enc) throws SqlJetException
buf
- SqlJetException
public static ISqlJetMemoryPointer fromString(java.lang.String s, SqlJetEncoding enc) throws SqlJetException
ByteBuffer
from String
.s
- enc
- SqlJetException
public static ISqlJetMemoryPointer translate(ISqlJetMemoryPointer buf, SqlJetEncoding from, SqlJetEncoding to) throws SqlJetException
ByteBuffer
from one charset to other charset.buf
- from
- to
- SqlJetException
public static final java.lang.String trim(java.lang.String s)
s
- public static int varintLen(long v)
public static final short toUnsigned(byte value)
public static final byte fromUnsigned(short value)
public static final int toUnsigned(short value)
public static final short fromUnsigned(int value)
public static long toUnsigned(int value)
public static final int fromUnsigned(long value)
public static final long get4byteUnsigned(byte[] p)
public static final long get4byteUnsigned(byte[] p, int pos)
public static final ISqlJetMemoryPointer put4byteUnsigned(long v)
public static final void put4byteUnsigned(byte[] p, int pos, long v)
public static final long get4byteUnsigned(ISqlJetMemoryPointer p)
public static final long get4byteUnsigned(ISqlJetMemoryPointer p, int pos)
public static final void put4byteUnsigned(ISqlJetMemoryPointer p, int pos, long v)
public static final void put4byteUnsigned(ISqlJetMemoryPointer p, long v)
public static final void memmove(ISqlJetMemoryPointer dst, ISqlJetMemoryPointer src, int n)
z
- slice
- n
- public static final void memmove(ISqlJetMemoryPointer dst, int dstOffs, ISqlJetMemoryPointer src, int srcOffs, int n)
z
- slice
- n
- public static final double atof(ISqlJetMemoryPointer z)
z
- public static final java.lang.Long atoi64(java.lang.String str)
str
- public static final long absolute(long i)
i
- public static final java.lang.Object[] addArrays(java.lang.Object[] array1, java.lang.Object[] array2)
key
- dataRowId
- public static final java.lang.Object[] insertArray(java.lang.Object[] intoArray, java.lang.Object[] insertArray, int pos)
public static final <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E e1, E... e)
public static final <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E e)
public static final <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E e1, E e2)
public static final <E extends java.lang.Enum<E>> java.util.EnumSet<E> of(E e1, E e2, E e3)
public static final <E extends java.lang.Enum<E>> java.util.EnumSet<E> noneOf(java.lang.Class<E> elementType)
public static final java.lang.Object[] adjustNumberTypes(java.lang.Object[] key)
key
- public static final SqlJetScope adjustScopeNumberTypes(SqlJetScope scope)
public static final java.lang.Object adjustNumberType(java.lang.Object value)
public static ISqlJetMemoryPointer streamToBuffer(java.io.InputStream stream) throws SqlJetException
value
- SqlJetException
public static byte[] readByteBuffer(ISqlJetMemoryPointer buffer)
buffer
- public static java.lang.Object[] copyArray(java.lang.Object[] array)
firstKey
- public static boolean isNumber(java.lang.String s, boolean[] realnum)
s
- realnum
- public static java.lang.Long doubleToInt64(java.lang.Double r)
r
- public static ISqlJetMemoryPointer fromByteBuffer(java.nio.ByteBuffer b)
value
- public static ISqlJetMemoryPointer getMoved(ISqlJetMemoryPointer preceding, ISqlJetMemoryPointer ptr, int offset)
Copyright © 2009-2010 TMate Software Ltd. All Rights Reserved.