view src/main/java/jp/ac/u_ryukyu/treevnc/ChengeDesktopSize.java @ 401:94c520535ef1

Fix selection panel
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Tue, 13 Oct 2015 18:21:46 +0900
parents 2d39a1f9558d
children
line wrap: on
line source

package jp.ac.u_ryukyu.treevnc;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

import com.glavsoft.rfb.encoding.EncodingType;

public class ChengeDesktopSize {

    private ByteBuffer msg;

    public ChengeDesktopSize(int width, int height,
                             EncodingType desktopSize, byte[] initData, short id) {
        msg = ByteBuffer.allocate(16+4+initData.length).order(ByteOrder.BIG_ENDIAN);
        msg.put((byte) 0); // FrameBufferUpdate
        msg.put((byte) 0); // padding
        msg.putShort((short) 1); // number of rectangle
        msg.putShort((short) id);
        msg.putShort((short) 0);
        msg.putShort((short) width);
        msg.putShort((short) height);
        msg.putInt(desktopSize.getId());
        msg.putInt(initData.length);
        msg.put(initData);

        msg.flip();

    }

    public ByteBuffer getMessage(){
        return msg;
    }


}