view src/main/java/jp/ac/u_ryukyu/treevnc/SendSingleDisplayWidth.java @ 290:c10e0dee7bbb

add READY_SHARE_SOUND msg, add function of receive READY_SHARE_SOUND msg, add sendSound thread.
author oc
date Tue, 13 Jan 2015 05:22:53 +0900
parents 16d3584ae7a0
children
line wrap: on
line source

package jp.ac.u_ryukyu.treevnc;

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.LinkedList;
import com.glavsoft.rfb.encoding.EncodingType;

/**
 * Created by OcBookPro on 15/01/10.
 */
public class SendSingleDisplayWidth {

    private ByteBuffer msg;
    private TreeRFBProto rfb;
    private int singleDisplayWidth;

    public SendSingleDisplayWidth() {
    }

    public ByteBuffer singleDisplayWidth(int i, int j, int singleDisplayWidth, int height) throws UnsupportedEncodingException {
        msg = ByteBuffer.allocate(24).order(ByteOrder.BIG_ENDIAN);
        msg.put((byte) 0); // FrameBufferUpdate
        msg.put((byte) 0); // padding
        msg.putShort((short) 1); // number of rectangle
        msg.putShort((short) i);
        msg.putShort((short) j);
        msg.putShort((short) singleDisplayWidth);
        msg.putShort((short) height);
        msg.putInt(EncodingType.SEND_SINGLE_DISPLAY_WIDTH.getId());
        msg.flip();
        return msg;
    }

}