annotate src/main/java/jp/ac/u_ryukyu/treevnc/CheckDelay.java @ 502:b9e73589202c

fix header
author oshiro
date Mon, 18 Feb 2019 17:08:34 +0900
parents 42fcc9419498
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
1 package jp.ac.u_ryukyu.treevnc;
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
2
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
3 import java.io.UnsupportedEncodingException;
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
4 import java.nio.ByteBuffer;
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
5 import java.nio.ByteOrder;
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
6 import com.glavsoft.rfb.encoding.EncodingType;
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
7
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
8
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
9 public class CheckDelay {
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
10
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
11 private ByteBuffer msg;
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
12
331
42fcc9419498 add error message, add lostParent case by fail to connectTo.
oc
parents: 236
diff changeset
13 public CheckDelay(int i, int j, int width, int height, long time, EncodingType checkDelay) {
502
b9e73589202c fix header
oshiro
parents: 331
diff changeset
14
236
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
15 msg = ByteBuffer.allocate(24).order(ByteOrder.BIG_ENDIAN);
502
b9e73589202c fix header
oshiro
parents: 331
diff changeset
16 checkDelay(msg, (short) i, (short) j, (short) width, (short) height, time, checkDelay);
b9e73589202c fix header
oshiro
parents: 331
diff changeset
17 msg.flip();
b9e73589202c fix header
oshiro
parents: 331
diff changeset
18
b9e73589202c fix header
oshiro
parents: 331
diff changeset
19 }
b9e73589202c fix header
oshiro
parents: 331
diff changeset
20
b9e73589202c fix header
oshiro
parents: 331
diff changeset
21 public static void checkDelay(ByteBuffer msg, int i, int j, int width, int height, long time, EncodingType checkDelay) {
236
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
22 msg.put((byte) 0); // FrameBufferUpdate
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
23 msg.put((byte) 0); // padding
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
24 msg.putShort((short) 1); // number of rectangle
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
25 msg.putShort((short) i);
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
26 msg.putShort((short) j);
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
27 msg.putShort((short) width);
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
28 msg.putShort((short) height);
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
29 msg.putInt(checkDelay.getId());
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
30 msg.putLong(time);
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
31 }
502
b9e73589202c fix header
oshiro
parents: 331
diff changeset
32
236
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
33 public ByteBuffer getMessage(){
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
34 return msg;
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
35 }
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
36
49762c621bd6 forget add CheckDelay.java
oc
parents:
diff changeset
37 }