1 4 package com.tc.io.serializer.impl; 5 6 import com.tc.io.serializer.api.Serializer; 7 8 import java.io.IOException ; 9 import java.io.ObjectInput ; 10 import java.io.ObjectOutput ; 11 12 15 public final class IntegerSerializer implements Serializer { 16 17 public void serializeTo(Object o, ObjectOutput out) throws IOException { 18 out.writeInt(((Integer )o).intValue()); 19 } 20 21 public Object deserializeFrom(ObjectInput in) throws IOException { 22 return new Integer (in.readInt()); 23 } 24 25 public byte getSerializerID() { 26 return INTEGER; 27 } 28 29 } | Popular Tags |