com.threerings.nexus.distrib.Streamer_DSignal Maven / Gradle / Ivy
The newest version!
//
// Nexus Core - a framework for developing distributed applications
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.distrib;
import com.threerings.nexus.io.Streamable;
import com.threerings.nexus.io.Streamer;
/**
* Handles the streaming of {@link DSignal} and/or nested classes.
*/
public class Streamer_DSignal
{
/**
* Handles the streaming of {@link DSignal.EmitEvent} instances.
*/
public static class EmitEvent
implements Streamer>
{
@Override
public Class> getObjectClass () {
return DSignal.EmitEvent.class;
}
@Override
public void writeObject (Streamable.Output out, DSignal.EmitEvent obj) {
writeObjectImpl(out, obj);
}
@Override
public DSignal.EmitEvent readObject (Streamable.Input in) {
return new DSignal.EmitEvent(
in.readInt(),
in.readShort(),
in.readValue()
);
}
public static void writeObjectImpl (Streamable.Output out, DSignal.EmitEvent obj) {
Streamer_DAttribute.Event.writeObjectImpl(out, obj);
out.writeValue(obj._event);
}
}
// no streamer for non-Streamable enclosing class: DSignal
}