out.write(buffer);
} else if (message instanceof ServerStatusBean) {
ServerStatusBean clientStatusBean = (ServerStatusBean) 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(0));//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
buffer.flip();
out.write(buffer);