if (!messageReadWrite)
if (bodyReadOnly)
   public void setObject(Serializable object) throws JMSException   {      if (!messageReadWrite)      {         throw new MessageNotWriteableException("setObject");      }      if (object == null)      {         objectBytes = null;         return;      }      try      {         if (object instanceof byte[])         {            //cheat for byte arrays            isByteArray = true;            objectBytes = new byte[((byte[]) object).length];            System.arraycopy(object, 0, objectBytes, 0, objectBytes.length);         }         else         {            isByteArray = false;            ByteArrayOutputStream byteArray = new ByteArrayOutputStream();            ObjectOutputStream objectOut = new ObjectOutputStream(byteArray);            objectOut.writeObject(object);            objectBytes = byteArray.toByteArray();            objectOut.close();         }      }      catch (IOException e)      {         log.error(e);         throw new MessageFormatException("Object cannot be serialized:" + e.getMessage());      }   }