if (!messageReadWrite)
if (!bodyWriteOnly)
   public void writeObject(Object value) throws JMSException   {      if (!messageReadWrite)      {         throw new MessageNotWriteableException("the message body is read-only");      }      try      {         if (value == null)         {            throw new NullPointerException("Attempt to write a new value");         }         if (value instanceof String)         {            //p.writeChars((String) value);            p.writeUTF((String) value);         }         else if (value instanceof Boolean)         {            p.writeBoolean(((Boolean) value).booleanValue());         }         else if (value instanceof Byte)         {            p.writeByte(((Byte) value).byteValue());         }         else if (value instanceof Short)         {            p.writeShort(((Short) value).shortValue());         }         else if (value instanceof Integer)         {            p.writeInt(((Integer) value).intValue());         }         else if (value instanceof Long)         {            p.writeLong(((Long) value).longValue());         }         else if (value instanceof Float)         {            p.writeFloat(((Float) value).floatValue());         }         else if (value instanceof Double)         {            p.writeDouble(((Double) value).doubleValue());         }         else if (value instanceof byte[])         {            p.write((byte[]) value, 0, ((byte[]) value).length);         }         else         {            throw new MessageFormatException("Invalid object for properties");         }      }      catch (IOException e)      {         throw new JMSException("IOException");      }   }