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