out.write(buffer);
} else if (message instanceof ClientStatusBean) {
ClientStatusBean clientStatusBean = (ClientStatusBean) message;
byte[] securityTokenAsByte = clientStatusBean.getPublicSID().getBytes();
Integer lengthSecurityToken = securityTokenAsByte.length;
Integer frameSize = 4 * 10 + lengthSecurityToken;
IoBuffer buffer = IoBuffer.allocate(frameSize, false);
//mode is weather 0(start) or 4(stop)
buffer.put(this.convertIntToByteArray(clientStatusBean.getMode()));// 4 Byte
buffer.put(this.convertIntToByteArray(ClientConnectionBean.getFrameNumber()));//4 Byte
buffer.put(this.convertIntToByteArray(lengthSecurityToken));//4 Byte
buffer.put(this.convertIntToByteArray(clientStatusBean.getXValue()));//4 Byte
buffer.put(this.convertIntToByteArray(clientStatusBean.getYValue()));//4 Byte
buffer.put(this.convertIntToByteArray(clientStatusBean.getWidth()));//4 Byte
buffer.put(this.convertIntToByteArray(clientStatusBean.getHeight()));//4 Byte
buffer.put(this.convertIntToByteArray(0));//4 Byte => this data is not needed
buffer.put(securityTokenAsByte);//32 Byte usually
buffer.put(this.convertIntToByteArray(clientStatusBean.getTileWidth()));//4 Byte
buffer.put(this.convertIntToByteArray(clientStatusBean.getTileHeight()));//4 Byte
//byte counter
ClientCaptureScreen.frameCalculated += frameSize;
if (ClientStartScreen.instance!=null) {
ClientStartScreen.instance.updateScreen();