KickJava   Java API By Example, From Geeks To Geeks.

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


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 public class StringUTFSerializer implements Serializer {
13
14   public void serializeTo(Object JavaDoc o, ObjectOutput JavaDoc out) throws IOException JavaDoc {
15     out.writeUTF((String JavaDoc) o);
16   }
17
18   public Object JavaDoc deserializeFrom(ObjectInput JavaDoc in) throws IOException JavaDoc {
19     return in.readUTF();
20   }
21
22   public byte getSerializerID() {
23     return STRING_UTF;
24   }
25
26 }
27
Popular Tags