| Modifier and Type | Class and Description |
|---|---|
static class |
Tools.Platform
An ENUM of platform constants.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addToLibPath(java.lang.String path)
Adds a a path to the current java.library.path.
|
static byte[] |
getBytesFromClass(java.lang.Class<?> clazz)
Gets bytes from a class.
|
static byte[] |
getBytesFromResource(java.lang.ClassLoader clazzLoader,
java.lang.String resource)
Gets bytes from a resource.
|
static byte[] |
getBytesFromStream(java.io.InputStream stream)
Gets class bytes from a stream.
|
static java.lang.String |
getCurrentPID()
Gets the current JVM PID.
|
static Tools |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Tools[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static Tools[] values()
for (Tools c : Tools.values()) System.out.println(c);
public static Tools valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static java.lang.String getCurrentPID()
public static byte[] getBytesFromStream(java.io.InputStream stream)
throws java.io.IOException
stream - The stream to get class bytes from.java.io.IOException - When an IO error occurs preventing us from retrieving class bytes.public static byte[] getBytesFromClass(java.lang.Class<?> clazz)
throws java.io.IOException
clazz - The class to retrieve bytes from.java.io.IOException - When an IO error occurs preventing us from retrieving class bytes.public static byte[] getBytesFromResource(java.lang.ClassLoader clazzLoader,
java.lang.String resource)
throws java.io.IOException
resource - The resource string.java.io.IOException - When an IO error occurs preventing us from retrieving class bytes.public static void addToLibPath(java.lang.String path)
throws java.lang.NoSuchFieldException,
java.lang.SecurityException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
path - The path to the library.java.lang.SecurityException - When we couldn't add a path due to the JVM security restrictions.java.lang.NoSuchFieldException - When we couldn't find the sys_paths field in the loaded library.java.lang.IllegalAccessException - When we could not access the actual sys_paths field in the loaded library.java.lang.IllegalArgumentException - When we're dumbasses and can't remember what field we wanted.