public class Utils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Utils.OS |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LIBPATH_IN_JAR |
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static <K> Pair<K,java.lang.Long>[] |
getPairs(Pair<K,? extends io.github.cvc5.AbstractPointer>[] abstractPointers) |
static long[] |
getPointers(io.github.cvc5.IPointer[] objects) |
static long[][] |
getPointers(io.github.cvc5.IPointer[][] objects) |
static Proof[] |
getProofs(long[] pointers) |
static java.lang.String |
getRational(Pair<java.math.BigInteger,java.math.BigInteger> pair)
Convert a pair of BigIntegers to a rational string a/b
|
static Pair<java.math.BigInteger,java.math.BigInteger> |
getRational(java.lang.String rational)
Convert a rational string a/b to a pair of BigIntegers
|
static Sort[] |
getSorts(long[] pointers) |
static Term[] |
getTerms(long[] pointers) |
static void |
loadLibraries()
Load cvc5 native libraries.
|
static void |
loadLibraryFromJar(java.nio.file.Path tempDir,
java.lang.String path,
java.lang.String filename)
Loads a native library from a specified path within a JAR file and loads it into the JVM.
|
static void |
transferTo(java.io.InputStream inputStream,
java.io.FileOutputStream outputStream)
Transfers all bytes from the provided
InputStream to the specified
FileOutputStream . |
static void |
validateUnsigned(int[] integers,
java.lang.String name) |
static void |
validateUnsigned(int integer,
java.lang.String name) |
static void |
validateUnsigned(long[] integers,
java.lang.String name) |
static void |
validateUnsigned(long integer,
java.lang.String name) |
public static final java.lang.String LIBPATH_IN_JAR
public static void transferTo(java.io.InputStream inputStream, java.io.FileOutputStream outputStream) throws java.io.IOException
InputStream
to the specified
FileOutputStream
.
Note: This method replicates the functionality of InputStream#transferTo(OutputStream), which was introduced in Java 9 (currently, the minimum required Java version is 1.8)
inputStream
- The input stream from which data is readoutputStream
- The output stream to which data is writtenjava.io.IOException
- If an I/O error occurs during reading or writingpublic static void loadLibraryFromJar(java.nio.file.Path tempDir, java.lang.String path, java.lang.String filename) throws java.io.FileNotFoundException, java.lang.Exception
path
- The path inside the JAR where the library is located (e.g., "/cvc5-libs").filename
- The name of the library file (e.g., "libcvc5.so").java.io.FileNotFoundException
- If the library cannot be foundjava.lang.Exception
- If an I/O error occurs or the library cannot be loadedpublic static void loadLibraries()
public static Sort[] getSorts(long[] pointers)
pointers
- The array of pointers.public static Term[] getTerms(long[] pointers)
pointers
- The array of pointers.public static Proof[] getProofs(long[] pointers)
pointers
- The array of pointers.public static long[] getPointers(io.github.cvc5.IPointer[] objects)
objects
- The one dimensional array of pointers.public static long[][] getPointers(io.github.cvc5.IPointer[][] objects)
objects
- The two dimensional array of pointers.public static void validateUnsigned(int integer, java.lang.String name) throws CVC5ApiException
CVC5ApiException
public static void validateUnsigned(long integer, java.lang.String name) throws CVC5ApiException
CVC5ApiException
public static void validateUnsigned(int[] integers, java.lang.String name) throws CVC5ApiException
CVC5ApiException
public static void validateUnsigned(long[] integers, java.lang.String name) throws CVC5ApiException
CVC5ApiException
public static <K> Pair<K,java.lang.Long>[] getPairs(Pair<K,? extends io.github.cvc5.AbstractPointer>[] abstractPointers)
public static Pair<java.math.BigInteger,java.math.BigInteger> getRational(java.lang.String rational)
rational
- The rational string.public static java.lang.String getRational(Pair<java.math.BigInteger,java.math.BigInteger> pair)
pair
- The pair of big integers.