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:
@@ -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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user