Logger.error(new Exception("Wrong packet type! "
+ message.toString()));
return;
}
try {
RSCPacket p = (RSCPacket) message;
byte[] data = p.getData();
int dataLength = data.length;
ByteBuffer buffer;
// byte[] debug = new byte[dataLength + 4];
if (!p.isBare()) {
buffer = ByteBuffer.allocate(dataLength + 3);
byte[] outlen = { (byte) (dataLength >> 8), (byte) (dataLength) };
buffer.put(outlen);
// debug[0] = outlen[0]; debug[1] = outlen[1];
int id = p.getID();
// debug[2] = (byte)offset; debug[3] = (byte)id;
buffer.put((byte) id);
} else {
buffer = ByteBuffer.allocate(dataLength);
}