|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavazoom.jl.decoder.JavaLayerUtils
public class JavaLayerUtils
The JavaLayerUtils class is not strictly part of the JavaLayer API. It serves to provide useful methods and system-wide hooks.
| Constructor Summary | |
|---|---|
JavaLayerUtils()
|
|
| Method Summary | |
|---|---|
static Object |
deserialize(InputStream in)
Deserializes an object from the given InputStream. |
static Object |
deserialize(InputStream in,
Class cls)
Deserializes the object contained in the given input stream. |
static Object |
deserializeArray(InputStream in,
Class elemType,
int length)
Deserializes an array from a given InputStream. |
static Object |
deserializeArrayResource(String name,
Class elemType,
int length)
|
static JavaLayerHook |
getHook()
|
static InputStream |
getResourceAsStream(String name)
Retrieves an InputStream for a named resource. |
static void |
serialize(OutputStream out,
Object obj)
|
static void |
setHook(JavaLayerHook hook0)
Sets the system-wide JavaLayer hook. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JavaLayerUtils()
| Method Detail |
|---|
public static Object deserialize(InputStream in,
Class cls)
throws IOException
in - The input stream to deserialize an object from.cls - The expected class of the deserialized object.
IOException
public static Object deserialize(InputStream in)
throws IOException
InputStream.
The deserialization is delegated to an
ObjectInputStream instance.
in - The InputStream to deserialize an object
from.
IOException - is thrown if there was a problem reading
the underlying stream, or an object could not be deserialized
from the stream.ObjectInputStream
public static Object deserializeArray(InputStream in,
Class elemType,
int length)
throws IOException
InputStream.
in - The InputStream to
deserialize an object from.elemType - The class denoting the type of the array
elements.length - The expected length of the array, or -1 if
any length is expected.
IOException
public static Object deserializeArrayResource(String name,
Class elemType,
int length)
throws IOException
IOException
public static void serialize(OutputStream out,
Object obj)
throws IOException
IOExceptionpublic static void setHook(JavaLayerHook hook0)
public static JavaLayerHook getHook()
public static InputStream getResourceAsStream(String name)
name - The name of the resource. This must be a simple
name, and not a qualified package name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||