summaryrefslogtreecommitdiff
path: root/sources/shared/remotecall/RemoteCall.java
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2009-02-18 17:33:22 +0000
committerPaul Buetow <paul@buetow.org>2009-02-18 17:33:22 +0000
commit4722100cba287b164957c658c2e035783e20c963 (patch)
tree35733fd3e50aeeb493e38ceaea83521a4710f0ac /sources/shared/remotecall/RemoteCall.java
parent61f7175cc3e51c0afaf63e380d03824a77464ba8 (diff)
moved sources
Diffstat (limited to 'sources/shared/remotecall/RemoteCall.java')
-rw-r--r--sources/shared/remotecall/RemoteCall.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/sources/shared/remotecall/RemoteCall.java b/sources/shared/remotecall/RemoteCall.java
new file mode 100644
index 0000000..8703f00
--- /dev/null
+++ b/sources/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);
+ }
+ }
+}