jp.develop.common.util
Class AmfUtil

java.lang.Object
  extended by jp.develop.common.util.AmfUtil

public final class AmfUtil
extends Object

Utilities for AMF encoding and decoding.

Author:
Waki Takeya
See Also:
AmfEncoder, AmfDecoder

Method Summary
static Object decode(byte[] bytes)
          Decode a instance from specified AMF bytes.
static Object decode(byte[] bytes, AmfDecoderOption option)
          Decode a instance from specified AMF bytes.
static
<T> T
decode(byte[] bytes, Class<? extends T> clazz)
          Decode the instance of specified class from AMF bytes.
static
<T> T
decode(byte[] bytes, Class<? extends T> clazz, AmfDecoderOption option)
          Decode the instance of specified class from AMF bytes.
static
<T> T
decode(byte[] bytes, Type type)
          Decode the instance of specified type from specified bytes.
static
<T> T
decode(byte[] bytes, Type type, AmfDecoderOption option)
          Decode the instance of specified type from specified bytes.
static Object decode(InputStream in)
          Decode a instance from specified input stream.
static Object decode(InputStream in, AmfDecoderOption option)
          Decode a instance from specified input stream.
static
<T> T
decode(InputStream in, Class<? extends T> clazz)
          Decode the instance of specified class from specified input stream.
static
<T> T
decode(InputStream in, Class<? extends T> clazz, AmfDecoderOption option)
          Decode the instance of specified class from specified input stream.
static
<T> T
decode(InputStream in, Type type)
          Decode the instance of specified type from specified input stream.
static
<T> T
decode(InputStream in, Type type, AmfDecoderOption option)
          Decode the instance of specified type from specified input stream.
static byte[] encode(Object obj)
          Encode the object to AMF bytes.
static byte[] encode(Object obj, AmfEncoderOption option)
          Encode the object to AMF bytes, according to specified configuration option.
static void encode(OutputStream out, Object obj)
          Encode the object as AMF to specified output stream.
static void encode(OutputStream out, Object obj, AmfEncoderOption option)
          Encode the object as AMF to specified output stream, according to specified configuration option.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

decode

public static <T> T decode(InputStream in,
                           Type type)
Decode the instance of specified type from specified input stream.

Type Parameters:
T - The type of result instance.
Parameters:
in - Input stream.
type - The type of result instance.
Returns:
The decoded instance.

decode

public static <T> T decode(InputStream in,
                           Class<? extends T> clazz)
Decode the instance of specified class from specified input stream.

Type Parameters:
T - The type of result instance.
Parameters:
in - Input stream.
clazz - The class of result instance.
Returns:
The decoded instance.

decode

public static Object decode(InputStream in)
Decode a instance from specified input stream.

Parameters:
in - Input stream.
Returns:
The decoded instance.

decode

public static <T> T decode(byte[] bytes,
                           Type type)
Decode the instance of specified type from specified bytes.

Type Parameters:
T - The type of result instance.
Parameters:
bytes - AMF data.
type - The type of result instance.
Returns:
The decoded instance.

decode

public static <T> T decode(byte[] bytes,
                           Class<? extends T> clazz)
Decode the instance of specified class from AMF bytes.

Type Parameters:
T - The type of result instance.
Parameters:
bytes - AMF bytes.
clazz - The class of result instance.
Returns:
The decoded instance.

decode

public static Object decode(byte[] bytes)
Decode a instance from specified AMF bytes.

Parameters:
bytes - AMF bytes.
Returns:
The decoded instance.

decode

public static <T> T decode(InputStream in,
                           Type type,
                           AmfDecoderOption option)
Decode the instance of specified type from specified input stream.

Type Parameters:
T - The type of result instance.
Parameters:
in - Input stream.
type - The type of result instance.
option - the configuration option of AMF decoder.
Returns:
The decoded instance.

decode

public static <T> T decode(InputStream in,
                           Class<? extends T> clazz,
                           AmfDecoderOption option)
Decode the instance of specified class from specified input stream.

Type Parameters:
T - The type of result instance.
Parameters:
in - Input stream.
clazz - The class of result instance.
option - the configuration option of AMF decoder.
Returns:
The decoded instance.

decode

public static Object decode(InputStream in,
                            AmfDecoderOption option)
Decode a instance from specified input stream.

Parameters:
in - Input stream.
option - the configuration option of AMF decoder.
Returns:
The decoded instance.

decode

public static <T> T decode(byte[] bytes,
                           Type type,
                           AmfDecoderOption option)
Decode the instance of specified type from specified bytes.

Type Parameters:
T - The type of result instance.
Parameters:
bytes - AMF data.
type - The type of result instance.
option - the configuration option of AMF decoder.
Returns:
The decoded instance.

decode

public static <T> T decode(byte[] bytes,
                           Class<? extends T> clazz,
                           AmfDecoderOption option)
Decode the instance of specified class from AMF bytes.

Type Parameters:
T - The type of result instance.
Parameters:
bytes - AMF bytes.
clazz - The class of result instance.
option - the configuration option of AMF decoder.
Returns:
The decoded instance.

decode

public static Object decode(byte[] bytes,
                            AmfDecoderOption option)
Decode a instance from specified AMF bytes.

Parameters:
bytes - AMF bytes.
option - the configuration option of AMF decoder.
Returns:
The decoded instance.

encode

public static void encode(OutputStream out,
                          Object obj)
Encode the object as AMF to specified output stream.

Parameters:
out - Output stream.
obj - The object to be encoded.

encode

public static byte[] encode(Object obj)
Encode the object to AMF bytes.

Parameters:
obj - The object to be encoded.
Returns:
Encoded AMF bytes.

encode

public static void encode(OutputStream out,
                          Object obj,
                          AmfEncoderOption option)
Encode the object as AMF to specified output stream, according to specified configuration option.

Parameters:
out - Output stream.
obj - The object to be encoded.
option - Configuration option.

encode

public static byte[] encode(Object obj,
                            AmfEncoderOption option)
Encode the object to AMF bytes, according to specified configuration option.

Parameters:
obj - The object to be encoded.
option - Configuration option.
Returns:
Encoded AMF bytes.