byte packINT32(byte[] buffer, int value) {
   swap32(value, buffer);
   return 4;
 }
 byte packFXP16_16(byte[] buffer, double value) {
   int intValue = (int) (value * 65536.0);
   swap32(intValue, buffer);
   return 4;
 }