Mercurial > hg > Applications > TreeVNC
changeset 575:a898e6335978
use mark in check
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 07 Feb 2020 12:12:27 +0900 |
parents | 3f1d576e182d |
children | d5138119d8c4 |
files | src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 1 files changed, 9 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Feb 06 22:29:23 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 07 12:12:27 2020 +0900 @@ -385,18 +385,15 @@ } in.readByte(); int numberOfRectangeles = in.readInt16(); - - Reader checkReaderC1 = new Reader(new ByteArrayInputStream(c1.array())); - checkReaderC1.readByte(); // message ID - checkReaderC1.readByte(); // padding - checkReaderC1.readInt16(); // num of rectangle - - FramebufferUpdateRectangle checkRect = new FramebufferUpdateRectangle(); - checkRect.fill(checkReaderC1); - int length = checkRect.width * checkRect.height * renderer.getBytesPerPixel(); - int zippedLength = (int) checkReaderC1.readUInt32(); - byte[] unzipBytes = unzip(checkReaderC1, zippedLength, length, checkRect.getEncodingType()); - CompairBytes(unzipBytes, checkBytes, flushOffset, flushEnd); + if (true) { + in.mark(c1.limit() - 4); + rect.fill(in); + int length = rect.width * rect.height * renderer.getBytesPerPixel(); + int zippedLength = (int) in.readUInt32(); + byte[] unzipBytes = unzip(in, zippedLength, length, rect.getEncodingType()); + CompairBytes(unzipBytes, checkBytes, flushOffset, flushEnd); + in.reset(); + } while (numberOfRectangeles-- > 0) { rect.fill(in); System.out.println("check rect " + rect);