Created the facilities for transmitting distributed objects and derived

classes over the wire (by inspecting their fields and sending those
directly).


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@8 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-05-30 00:16:00 +00:00
parent a523e71302
commit 9cd146a43c
14 changed files with 456 additions and 23 deletions
@@ -0,0 +1,29 @@
//
// $Id: BooleanFieldMarshaller.java,v 1.1 2001/05/30 00:16:00 mdb Exp $
package com.samskivert.cocktail.cher.dobj.net;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.lang.reflect.Field;
import com.samskivert.cocktail.cher.dobj.DObject;
public class BooleanFieldMarshaller implements FieldMarshaller
{
/** This is the sort of field that we marshall. */
public boolean prototype;
public void writeTo (DataOutputStream out, Field field, DObject dobj)
throws IOException, IllegalAccessException
{
out.writeBoolean(field.getBoolean(dobj));
}
public void readFrom (DataInputStream in, Field field, DObject dobj)
throws IOException, IllegalAccessException
{
field.setBoolean(dobj, in.readBoolean());
}
}