|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xml.security.utils.JavaUtils
A collection of different, general-purpose methods for JAVA-specific things
Method Summary | |
static boolean |
binaryCompare(byte[] refBytes,
byte[] c14nBytes)
Returns true if both byte arrays are bytewise equal, false if the differ. |
static byte[] |
getBytesFromFile(java.lang.String fileName)
Method getBytesFromFile |
static byte[] |
getBytesFromStream(java.io.InputStream inputStream)
This method reads all bytes from the given InputStream till EOF and returns them as a byte array. |
static boolean |
implementsInterface(java.lang.Object object,
java.lang.String interfaceName)
Checks whether an object implements a specific interface. |
static boolean |
instanceOf(java.lang.Object object,
java.lang.String className)
|
static void |
runGC()
Method runGC |
static void |
writeBytesToFilename(java.lang.String filename,
byte[] bytes)
Method writeBytesToFilename |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean implementsInterface(java.lang.Object object, java.lang.String interfaceName)
org.w3c.dom.Document doc = ...; // some init boolean this_is_true = JavaUtils.implementsInterface(doc.getDocumentElement(), "org.w3c.dom.Element"); boolean this_is_true_too = JavaUtils.implementsInterface(doc.getDocumentElement(), "org.w3c.dom.Node");
object
- which is to be checkedinterfaceName
- is the String of the Interface
true
if the object implements the specified interfacepublic static boolean instanceOf(java.lang.Object object, java.lang.String className)
object
- className
- public static boolean binaryCompare(byte[] refBytes, byte[] c14nBytes)
refBytes
- c14nBytes
-
MessageDigest.isEqual(byte[], byte[])
public static byte[] getBytesFromFile(java.lang.String fileName) throws java.io.FileNotFoundException, java.io.IOException
fileName
-
java.io.FileNotFoundException
java.io.IOException
public static void writeBytesToFilename(java.lang.String filename, byte[] bytes)
filename
- bytes
- public static byte[] getBytesFromStream(java.io.InputStream inputStream) throws java.io.IOException
inputStream
-
java.io.FileNotFoundException
java.io.IOException
public static void runGC()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |