diff options
| author | Paul Buetow <paul@buetow.org> | 2009-02-08 01:37:25 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2009-02-08 01:37:25 +0000 |
| commit | 69f0e6b0bf0dc0a6c6fe8ccf17c74960697ca10c (patch) | |
| tree | 4b99d266e90f2ac93e46b499b6e02c6dd4bcae18 /shared/remotecall/RemoteCall.java | |
1.0 releasedv0.1
Diffstat (limited to 'shared/remotecall/RemoteCall.java')
| -rw-r--r-- | shared/remotecall/RemoteCall.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/shared/remotecall/RemoteCall.java b/shared/remotecall/RemoteCall.java new file mode 100644 index 0000000..5accf28 --- /dev/null +++ b/shared/remotecall/RemoteCall.java @@ -0,0 +1,29 @@ +package shared.remotecall; + +import java.io.*; + +/** + * This is the abstract base class of all other classes of the shared.remotecall package. + * Its defining some common methods. + * @author buetow + * + */ +public abstract class RemoteCall { + /** + * This is a help method for writeObject of the child classes, needed for ojbect serialization (sending part). + * It checks if object is defined. If yes, it will be written to the given object output stream with a leading + * flag with the value true. Otherwise only the false flag will be written to the object output stream. + * @param objectOutputStream Specifies the output stream. + * @throws IOException + */ + protected final void writeObjectIfDefined(ObjectOutputStream objectOutputStream, Object object) + throws IOException { + if (object == null) { + objectOutputStream.writeBoolean(false); + + } else { + objectOutputStream.writeBoolean(true); + objectOutputStream.writeObject(object); + } + } +} |
