Mercurial > hg > Applications > TightVNC_orginal
comparison src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java @ 26:73b13bc335c2
add ZRLEESender.java, NullRenderer.java and NullRepaintController.java
author | one |
---|---|
date | Thu, 30 Aug 2012 16:51:46 +0900 |
parents | |
children | 18fad65bc447 |
comparison
equal
deleted
inserted
replaced
25:8c15ff5f0f8e | 26:73b13bc335c2 |
---|---|
1 package com.glavsoft.rfb.encoding.decoder; | |
2 | |
3 import jp.ac.u_ryukyu.treevnc.server.MyRfbProtoProxy; | |
4 | |
5 import com.glavsoft.drawing.Renderer; | |
6 import com.glavsoft.exceptions.TransportException; | |
7 import com.glavsoft.rfb.encoding.EncodingType; | |
8 import com.glavsoft.transport.Reader; | |
9 | |
10 public class ZRLEESender extends Decoder { | |
11 | |
12 private MyRfbProtoProxy rfb; | |
13 | |
14 public ZRLEESender(MyRfbProtoProxy rfb) { | |
15 this.rfb = rfb; | |
16 } | |
17 | |
18 @Override | |
19 public void decode(Reader reader, Renderer renderer, | |
20 FramebufferUpdateRectangle rect) throws TransportException { | |
21 int dataLen = getZrleLength(rect,reader); | |
22 reader.reset(); | |
23 rfb.readSendData(dataLen, reader); | |
24 } | |
25 | |
26 private int getZrleLength(FramebufferUpdateRectangle rect,Reader reader) | |
27 throws TransportException { | |
28 int zrleLength = 0; | |
29 if (rect.getEncodingType() == EncodingType.ZRLE | |
30 || rect.getEncodingType() == EncodingType.ZRLEE | |
31 || rect.getEncodingType() == EncodingType.ZLIB) { | |
32 zrleLength = reader.readInt32(); | |
33 } | |
34 return zrleLength + 20; | |
35 } | |
36 | |
37 | |
38 } |