96
|
1 package jp.ac.u_ryukyu.treevnc;
|
|
2
|
|
3 import java.nio.ByteBuffer;
|
97
|
4 import java.nio.ByteOrder;
|
96
|
5
|
|
6 import com.glavsoft.rfb.encoding.EncodingType;
|
|
7
|
|
8 public class UpdateRectangleMessage {
|
|
9
|
97
|
10 private ByteBuffer msg = ByteBuffer.allocate(16).order(ByteOrder.LITTLE_ENDIAN);
|
96
|
11
|
|
12 public UpdateRectangleMessage(int i, int j, int width, int height,
|
|
13 EncodingType desktopSize) {
|
97
|
14
|
96
|
15 msg.put((byte) 0); // FrameBufferUpdate
|
|
16 msg.put((byte) 0); // padding
|
97
|
17 msg.putShort((short) 1); // number of rectangle
|
|
18 msg.putShort((short) i);
|
|
19 msg.putShort((short) j);
|
|
20 msg.putShort((short) width);
|
|
21 msg.putShort((short) height);
|
96
|
22 msg.putInt(desktopSize.getId());
|
|
23
|
|
24 msg.flip();
|
|
25
|
|
26 }
|
|
27
|
97
|
28 public ByteBuffer getMessage(){
|
96
|
29 return msg;
|
|
30 }
|
|
31
|
|
32
|
|
33 }
|