diff options
author | Matthew Johnson <mjj29@qadesh.matthew.ath.cx> | 2009-03-15 18:04:51 +0000 |
---|---|---|
committer | Matthew Johnson <mjj29@qadesh.matthew.ath.cx> | 2009-03-15 18:04:51 +0000 |
commit | 78e7e01c64c3ccb5ca3e802b0931b88f6ec9207a (patch) | |
tree | ea5b93b4d7218be8fab52752c3361a985688c3c4 /org | |
parent | 3201f076de801ba502c63ded3a55972d65ea0aa0 (diff) |
fix dependency on unix.jar even in tcp mode
Diffstat (limited to 'org')
-rw-r--r-- | org/freedesktop/dbus/MessageWriter.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/org/freedesktop/dbus/MessageWriter.java b/org/freedesktop/dbus/MessageWriter.java index bf19d03..00fb7f2 100644 --- a/org/freedesktop/dbus/MessageWriter.java +++ b/org/freedesktop/dbus/MessageWriter.java @@ -20,9 +20,16 @@ import cx.ath.matthew.utils.Hexdump; public class MessageWriter { private OutputStream out; + private boolean isunix; public MessageWriter(OutputStream out) { this.out = out; + this.isunix = false; + try { + if (out instanceof USOutputStream) + this.isunix = true; + } catch (Throwable t) { + } } public void writeMessage(Message m) throws IOException { @@ -34,7 +41,7 @@ public class MessageWriter if (Debug.debug) Debug.print(Debug.WARN, "Message "+m+" wire-data was null!"); return; } - if (out instanceof USOutputStream) { + if (isunix) { if (Debug.debug) { Debug.print(Debug.DEBUG, "Writing all "+m.getWireData().length+" buffers simultaneously to Unix Socket"); for (byte[] buf: m.getWireData()) |