|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.sqlunit.utils.DigestUtils
public final class DigestUtils
Provides utility methods needed for MD5 Digestion.
Method Summary | |
---|---|
static byte[] |
getByteCodeForObject(java.lang.Object obj)
Converts an object into an array of bytes. |
static java.lang.String |
getMD5CheckSum(java.io.InputStream istream)
Returns the MD5 Checksum for a file or memory buffer represented by the specified InputStream object. |
static java.lang.String |
getMD5CheckSum(java.lang.String str)
Takes a String and does the right thing to convert it to MD5 according to the following rules. |
static java.lang.String |
getStringifiedObject(byte[] bytes)
Returns the String representation of an Object which is supplied to the method as a byte array. |
static java.lang.String |
getStringifiedObject(java.io.InputStream istream)
Returns the String representation of an Object from an InputStream. |
static java.util.Map |
getTempFileMappings()
Gets the temporary file mappings from the Symbol Table. |
static boolean |
isSerializedJavaObject(byte[] bytes)
Checks the byte header for the presence of the magic number "aced" and returns true if it finds it. |
static byte[] |
readBytesFromStream(java.io.InputStream istream)
Reads an InputStream and returns an array of bytes. |
static void |
writeTempFile(byte[] bytes)
Writes the bytes into a temporary file and adds the mapping of the the location where it was written to the actual file name in the SymbolTable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getMD5CheckSum(java.io.InputStream istream) throws SQLUnitException
istream
- a File or Memory buffer containing data to be digested.
SQLUnitException
- if there was a problem generating MD5.public static java.lang.String getMD5CheckSum(java.lang.String str) throws SQLUnitException
str
- the String to convert to MD5.
SQLUnitException
- if there was a problem with the conversion.public static java.lang.String getStringifiedObject(java.io.InputStream istream) throws SQLUnitException
istream
- the InputStream to read.
SQLUnitException
- if there was a problem with the conversion.public static java.lang.String getStringifiedObject(byte[] bytes) throws SQLUnitException
bytes
- the bytes representing the Object to stringify.
SQLUnitException
- if there was a problem with the conversion.public static byte[] readBytesFromStream(java.io.InputStream istream) throws SQLUnitException
istream
- the InputStream to read.
SQLUnitException
- if there was a problem with reading.public static byte[] getByteCodeForObject(java.lang.Object obj) throws SQLUnitException
obj
- the Object to get bytes for.
SQLUnitException
- if there was a problem generating bytecode.public static boolean isSerializedJavaObject(byte[] bytes)
bytes
- the byte code to check.
public static void writeTempFile(byte[] bytes) throws java.lang.Exception
bytes
- the bytes to write to the temporary file.
java.lang.Exception
- if there was a problem writing the file.public static java.util.Map getTempFileMappings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |