From 1cc0194565a73194bacea13f52dfed3b3cb57dcc Mon Sep 17 00:00:00 2001 From: enikey Date: Wed, 24 Dec 2008 04:01:27 +0000 Subject: [BugFix] Added check to verify that data can be written to record output stream before writting. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3449 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- java/src/com/tightvnc/vncviewer/RecordOutputStream.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'java') diff --git a/java/src/com/tightvnc/vncviewer/RecordOutputStream.java b/java/src/com/tightvnc/vncviewer/RecordOutputStream.java index 188695cc..a19384e5 100644 --- a/java/src/com/tightvnc/vncviewer/RecordOutputStream.java +++ b/java/src/com/tightvnc/vncviewer/RecordOutputStream.java @@ -10,15 +10,18 @@ public class RecordOutputStream implements DataOutput { } public void write(byte[] b) throws IOException { - recordInterface.write(b); + if (recordInterface.canWrite()) + recordInterface.write(b); } public void write(byte[] b, int off, int len) throws IOException { - recordInterface.write(b, off, len); + if (recordInterface.canWrite()) + recordInterface.write(b, off, len); } public void write(int b) throws IOException { - recordInterface.writeIntBE(b); + if (recordInterface.canWrite()) + recordInterface.writeIntBE(b); } public void writeBoolean(boolean v) { } -- cgit v1.2.3