com.cedarsoft.utils.serialization
Interface Serializer<T,C>

Type Parameters:
T - the type of the objects
C - the type of the context
All Known Subinterfaces:
ExtendedSerializer<T>
All Known Implementing Classes:
AbstractSerializer

public interface Serializer<T,C>

Serializes objects


Method Summary
 T deserialize(java.io.InputStream in, C context)
          Deserializes the object from the input stream
 void serialize(T object, java.io.OutputStream out, C context)
          Serializes the object to the given output stream
 

Method Detail

serialize

void serialize(@NotNull
               T object,
               @NotNull
               java.io.OutputStream out,
               @Nullable
               C context)
               throws java.io.IOException
Serializes the object to the given output stream

Parameters:
object - the object
out - the out stream
context - the context (optional)
Throws:
java.io.IOException

deserialize

@NotNull
T deserialize(@NotNull
                      java.io.InputStream in,
                      @Nullable
                      C context)
              throws java.io.IOException
Deserializes the object from the input stream

Parameters:
in - the input stream
context - the context (optional)
Returns:
the deserialized object
Throws:
java.io.IOException


Copyright © 2009 cedarsoft GmbH. All Rights Reserved.