public final class PlatformContext
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static double |
convertCDoubleToDouble(byte[] arr)
Converts a native byte representation of a double precision
floating-point value to a
double . |
static double |
convertCFloatToDouble(byte[] arr)
Converts a native byte representation of a single precision
floating-point value to a
double . |
static double |
convertCLongDoubleToDouble(byte[] arr)
Converts a native byte representation of a long double precision
floating-point value to a
double . |
static byte[] |
convertDoubleToCDouble(double d)
Converts a double precision floating-point value to platform native byte
representation.
|
static byte[] |
convertDoubleToCFloat(double f)
Converts a single precision floating-point value to platform native byte
representation.
|
static byte[] |
convertDoubleToCLongDouble(double d)
Converts a double precision floating-point value to platform native byte
representation of
long double type. |
static int |
getAlignedParameterLength(int paramLen)
Returns the length of the aligned parameter on the stack.
|
static int |
getAlignedParameterLength(Parameter p)
Returns the length of the aligned parameter on the stack.
|
static int |
getAlignedPointerLength()
Returns the length of the aligned pointer on the stack.
|
static int |
getBoolLength()
Returns a bool type length (
sizeof(bool) ). |
static int |
getCharLength()
Returns a character length (
sizeof(char) ). |
static byte |
getDefaultCallingConvention()
Returns platform default calling conventions for libraries.
|
static short |
getDefaultStructureAlignment()
Returns platform required structure alignment.
|
static int |
getDoubleLength()
Returns a double precision floating-point value length (
sizeof(double) ). |
static int |
getFloatLength()
Returns a single precision floating-point value length (
sizeof(float) ). |
static int |
getIntLength()
Returns an integer length (
sizeof(int) ). |
static int |
getLongDoubleLength()
Returns a long double precision floating-point value length (
sizeof(long
double) ). |
static int |
getLongLength()
Returns a long integer length (
sizeof(long) ). |
static short |
getParameterAlignment()
Returns platform default parameter alignment for function calls.
|
static int |
getPointerLength()
Returns a pointer length (
sizeof(void*) ). |
static int |
getShortLength()
Returns a short integer length (
sizeof(short) ). |
static int |
getWideCharLength()
Returns a wide character length (
sizeof(wchar_t) ). |
static boolean |
isAIX() |
static boolean |
isLeopard() |
static boolean |
isLinux() |
static boolean |
isLion() |
static boolean |
isLittleEndian()
Returns
true if the underlying platform byte order is little
endian, that is it stores the least significant byte of a value first. |
static boolean |
isMacNewerThanTigerButOlderThanMavericks() |
static boolean |
isMacOS() |
static boolean |
isMountainLion() |
static boolean |
isPPC() |
static boolean |
isPPC64() |
static boolean |
isSnowLeopard() |
static boolean |
isSparc() |
static boolean |
isSparc64() |
static boolean |
isSunOS() |
static boolean |
isTiger() |
static boolean |
isUnicode() |
static boolean |
isWindows() |
static boolean |
isX32() |
static boolean |
isX64() |
static int |
strlen(long ptrToString) |
static int |
wcslen(long ptrToWideString) |
public static boolean isWindows()
public static boolean isLinux()
public static boolean isMacOS()
public static boolean isSunOS()
public static boolean isAIX()
public static boolean isX32()
public static boolean isX64()
public static boolean isPPC()
public static boolean isPPC64()
public static boolean isSparc()
public static boolean isSparc64()
public static int getCharLength()
sizeof(char)
).public static int getWideCharLength()
sizeof(wchar_t)
).public static int getBoolLength()
sizeof(bool)
).public static int getPointerLength()
sizeof(void*)
).public static int getShortLength()
sizeof(short)
).public static int getIntLength()
sizeof(int)
).public static int getLongLength()
sizeof(long)
).public static int getFloatLength()
sizeof(float)
).public static int getDoubleLength()
sizeof(double)
).public static int getLongDoubleLength()
sizeof(long
double)
). On certain platforms long double
can be the
same as double
.public static boolean isLittleEndian()
true
if the underlying platform byte order is little
endian, that is it stores the least significant byte of a value first.public static short getParameterAlignment()
public static short getDefaultStructureAlignment()
public static byte getDefaultCallingConvention()
public static byte[] convertDoubleToCFloat(double f)
public static double convertCFloatToDouble(byte[] arr)
double
.public static byte[] convertDoubleToCDouble(double d)
public static double convertCDoubleToDouble(byte[] arr)
double
.public static byte[] convertDoubleToCLongDouble(double d)
long double
type.public static double convertCLongDoubleToDouble(byte[] arr)
double
. This conversion may lead
to value loss if java double does not have enough precision.public static int strlen(long ptrToString)
public static int wcslen(long ptrToWideString)
public static boolean isUnicode()
public static int getAlignedPointerLength()
public static int getAlignedParameterLength(int paramLen)
paramLen
- unaligned length of the parameter.public static int getAlignedParameterLength(Parameter p)
p
- the parameter.public static boolean isTiger()
public static boolean isLeopard()
public static boolean isSnowLeopard()
public static boolean isLion()
public static boolean isMountainLion()
public static boolean isMacNewerThanTigerButOlderThanMavericks()