From: enikey Date: Wed, 24 Dec 2008 04:37:56 +0000 (+0000) Subject: [Refactoring] Write record data to data output interface instead of record interface... X-Git-Tag: v0.0.90~232 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8beb77813825407454bc62877e882e5b0bd18ddb;p=tigervnc.git [Refactoring] Write record data to data output interface instead of record interface in CoRRE, RRE, Hextile decoder classes. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3452 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/java/src/com/tightvnc/decoder/CoRREDecoder.java b/java/src/com/tightvnc/decoder/CoRREDecoder.java index 56cb7ab6..3ab437af 100644 --- a/java/src/com/tightvnc/decoder/CoRREDecoder.java +++ b/java/src/com/tightvnc/decoder/CoRREDecoder.java @@ -43,13 +43,13 @@ public class CoRREDecoder extends RawDecoder { rfbis.readFully(buf); // - // Save decoded data to RecordInterface + // Save decoded data to data output stream // - if (rec.canWrite()) { - rec.writeIntBE(nSubrects); - rec.write(bg_buf); - rec.write(buf); + if (dos != null) { + dos.writeInt(nSubrects); + dos.write(bg_buf); + dos.write(buf); } int sx, sy, sw, sh; diff --git a/java/src/com/tightvnc/decoder/HextileDecoder.java b/java/src/com/tightvnc/decoder/HextileDecoder.java index adf59370..1e4ef093 100644 --- a/java/src/com/tightvnc/decoder/HextileDecoder.java +++ b/java/src/com/tightvnc/decoder/HextileDecoder.java @@ -76,11 +76,11 @@ public class HextileDecoder extends RawDecoder { int subencoding = rfbis.readU8(); // - // Save decoded data to RecordInterface + // Save decoded data to data output stream // - if (rec.canWrite()) { - rec.writeByte((byte)subencoding); + if (dos != null) { + dos.writeByte((byte)subencoding); } // Is it a raw-encoded sub-rectangle? @@ -102,11 +102,11 @@ public class HextileDecoder extends RawDecoder { } // - // Save decoded data to RecordInterface + // Save decoded data to data output stream // - if (rec.canWrite()) { - rec.write(cbuf); + if (dos != null) { + dos.write(cbuf); } } graphics.setColor(hextile_bg); @@ -122,11 +122,11 @@ public class HextileDecoder extends RawDecoder { } // - // Save decoded data to RecordInterface + // Save decoded data to data output stream // - if (rec.canWrite()) { - rec.write(cbuf); + if (dos != null) { + dos.write(cbuf); } } @@ -143,12 +143,12 @@ public class HextileDecoder extends RawDecoder { rfbis.readFully(buf); // - // Save decoded data to RecordInterface + // Save decoded data to data output stream // - if (rec.canWrite()) { - rec.writeByte((byte)nSubrects); - rec.write(buf); + if (dos != null) { + dos.writeByte((byte)nSubrects); + dos.write(buf); } int b1, b2, sx, sy, sw, sh; diff --git a/java/src/com/tightvnc/decoder/RREDecoder.java b/java/src/com/tightvnc/decoder/RREDecoder.java index ce70606d..72a5fdfb 100644 --- a/java/src/com/tightvnc/decoder/RREDecoder.java +++ b/java/src/com/tightvnc/decoder/RREDecoder.java @@ -44,12 +44,12 @@ public class RREDecoder extends RawDecoder { DataInputStream ds = new DataInputStream(new ByteArrayInputStream(buf)); // - // Save decoded data to RecordInterface + // Save decoded data to data output stream // - if (rec.canWrite()) { - rec.writeIntBE(nSubrects); - rec.write(bg_buf); - rec.write(buf); + if (dos != null) { + dos.writeInt(nSubrects); + dos.write(bg_buf); + dos.write(buf); } int sx, sy, sw, sh;