Mercurial > hg > Applications > TreeVNC
view src/main/java/jp/ac/u_ryukyu/treevnc/ScreenChangeRequest.java @ 107:660b296d4f75
send change screen command throw the tree.
author | oc |
---|---|
date | Fri, 23 May 2014 17:56:42 +0900 |
parents | |
children | 1bceae0f5bd3 |
line wrap: on
line source
package jp.ac.u_ryukyu.treevnc; import com.glavsoft.exceptions.TransportException; import com.glavsoft.rfb.client.ClientToServerMessage; import com.glavsoft.transport.Writer; /** * ClientCutText * The client has new ISO 8859-1 (Latin-1) text in its cut buffer. Ends of lines are repre- * sented by the linefeed / newline character (value 10) alone. No carriage-return (value * 13) is needed. There is currently no way to transfer text outside the Latin-1 character * set. * 1 - U8 - 6 * 3 - - padding * 4 - U32 - length * length - U8 array - text */ public class ScreenChangeRequest implements ClientToServerMessage { private final byte [] bytes; public ScreenChangeRequest(byte[] bytes) { this.bytes = bytes; } @Override public void send(Writer writer) throws TransportException { writer.write(SERVER_CHANGE_REQUEST); writer.writeByte(0); writer.writeInt16(0); // padding writer.write(bytes.length); writer.write(bytes); // TODO: [dime] convert 'text' String to byte arrya using right charset writer.flush(); } @Override public String toString() { return "ClientCutTextMessage: [length: " + bytes.length +", text: ...]"; } }