21 namespace Deveel.Data.Serialization {
24 : this(Encoding.Unicode) {
29 throw new ArgumentNullException(
"encoding");
34 protected virtual Encoding Encoding {
get;
private set; }
37 using (var writer =
new BinaryWriter(outputStream)) {
38 Serialize((T)obj, writer);
43 using (var reader =
new BinaryReader(inputStream)) {
44 return Deserialize(reader);
49 Serialize((T)obj, writer);
53 return Deserialize(reader);
56 public abstract void Serialize(T obj, BinaryWriter writer);
58 public abstract T Deserialize(BinaryReader reader);
object Deserialize(Stream inputStream)
void Serialize(object obj, Stream outputStream)
ObjectBinarySerializer(Encoding encoding)
void Serialize(object obj, BinaryWriter writer)
object Deserialize(BinaryReader reader)