|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfabric.common.Util
public final class Util
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | ||
|---|---|---|
static
|
chain(java.lang.Iterable<T>... iters)
Returns an iterable that iterates over the elements of the iterables passed in. |
|
static java.lang.Object |
deserialize(byte[] bytes)
Turns an array of bytes into an object using Java serialization. |
|
static byte[] |
hash(java.lang.Class<?> c)
Generates a cryptographically secure hash of the given class. |
|
static byte[] |
hashClass(Codebase codebase,
java.lang.String className)
|
|
static java.net.URL |
locateClass(Codebase codebase,
java.lang.String className)
|
|
static byte[] |
serialize(java.lang.Object obj)
Turns an object into an array of bytes using Java serialization. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static byte[] hash(java.lang.Class<?> c)
throws java.io.IOException
java.io.IOException
public static byte[] hashClass(Codebase codebase,
java.lang.String className)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public static java.net.URL locateClass(Codebase codebase,
java.lang.String className)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic static <T> java.lang.Iterable<T> chain(java.lang.Iterable<T>... iters)
Returns an iterable that iterates over the elements of the iterables passed in. The common use is:
for (T o : Utils.chain(a, b, c)) o.f()which will call f() on each element of a, then each element of b, then each element of c.
This is intended to be more efficient and easier than creating a new collection containing the contents.
T - the types of the elements of the iterablesiters - the iterables to chain
public static byte[] serialize(java.lang.Object obj)
throws java.io.IOException
java.io.IOException
public static java.lang.Object deserialize(byte[] bytes)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||