Mercurial > hg > Applications > TreeVNC
comparison src/main/java/jp/ac/u_ryukyu/treevnc/RequestSingleDisplayWidth.java @ 301:ae7deb002b5f
send and receive single display size
author | oc |
---|---|
date | Sun, 18 Jan 2015 08:36:06 +0900 |
parents | 9c5874d0f37e |
children |
comparison
equal
deleted
inserted
replaced
300:0b75fdbb8c11 | 301:ae7deb002b5f |
---|---|
1 package jp.ac.u_ryukyu.treevnc; | 1 package jp.ac.u_ryukyu.treevnc; |
2 | 2 |
3 import com.glavsoft.exceptions.TransportException; | 3 import com.glavsoft.exceptions.TransportException; |
4 import com.glavsoft.rfb.client.ClientToServerMessage; | 4 import com.glavsoft.rfb.client.ClientToServerMessage; |
5 import com.glavsoft.rfb.encoding.EncodingType; | |
6 import com.glavsoft.transport.Writer; | 5 import com.glavsoft.transport.Writer; |
7 | 6 |
8 import java.nio.ByteBuffer; | 7 import java.nio.ByteBuffer; |
9 import java.nio.ByteOrder; | 8 import java.nio.ByteOrder; |
10 import java.util.LinkedList; | |
11 | 9 |
12 /** | 10 /** |
13 * Created by OcBookPro on 15/01/10. | 11 * Created by OcBookPro on 15/01/10. |
14 */ | 12 */ |
15 public class RequestSingleDisplayWidth implements ClientToServerMessage { | 13 public class RequestSingleDisplayWidth implements ClientToServerMessage { |
21 | 19 |
22 @Override | 20 @Override |
23 public void send(Writer writer) throws TransportException { | 21 public void send(Writer writer) throws TransportException { |
24 ByteBuffer out = ByteBuffer.allocate(2); | 22 ByteBuffer out = ByteBuffer.allocate(2); |
25 out.order(ByteOrder.BIG_ENDIAN); | 23 out.order(ByteOrder.BIG_ENDIAN); |
26 out.put(REQUEST_SINGLE_DISPLAY_WIDTH); | 24 out.put(REQUEST_SINGLE_DISPLAY_SIZE); |
27 out.put((byte)0); // padding | 25 out.put((byte)0); // padding |
28 writer.write(out.array(), 0, out.position()); | 26 writer.write(out.array(), 0, out.position()); |
29 writer.flush(); | 27 writer.flush(); |
30 } | 28 } |
31 } | 29 } |