sds.more
Class Codec

java.lang.Object
  extended by sds.more.Codec

public final class Codec
extends java.lang.Object

SDS encoder/decoder used to marshall requests and unmarshall responses

Author:
ncottin

Constructor Summary
Codec()
           
 
Method Summary
static java.lang.Object decode(java.io.InputStream in)
           Decodes an object from a source stream
static void encode(java.io.Serializable obj, java.io.OutputStream out)
           Creates an encoding of the given object and writes the resulting flow to the provided output stream
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Codec

public Codec()
Method Detail

encode

public static void encode(java.io.Serializable obj,
                          java.io.OutputStream out)
                   throws java.io.IOException

Creates an encoding of the given object and writes the resulting flow to the provided output stream

Parameters:
obj - The object to encode
out - The destination stream
Throws:
java.io.IOException - An argument is null or an internal encoding error occurred

decode

public static java.lang.Object decode(java.io.InputStream in)
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException

Decodes an object from a source stream

Parameters:
in - The source stream use to recreate the object from
Returns:
A non-null object read from the source stream
Throws:
java.io.IOException - The source stream is null or does not contain a valid encoding
java.lang.ClassNotFoundException - The object class is locally unknown