KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > io > serializer > impl > ObjectSerializer


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.io.serializer.impl;
5
6 import com.tc.io.serializer.api.Serializer;
7
8 import java.io.IOException JavaDoc;
9 import java.io.ObjectInput JavaDoc;
10 import java.io.ObjectOutput JavaDoc;
11
12 /**
13  * Objects
14  */

15 public final class ObjectSerializer implements Serializer {
16   public void serializeTo(Object JavaDoc o, ObjectOutput JavaDoc out) throws IOException JavaDoc {
17     out.writeObject(o);
18   }
19
20   public Object JavaDoc deserializeFrom(ObjectInput JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc {
21     return in.readObject();
22   }
23
24   public byte getSerializerID() {
25     return OBJECT;
26   }
27 }
Popular Tags