out.writeBoolean(bodyWriteOnly);
   public void writeExternal(ObjectOutput out) throws IOException   {      byte[] arrayToSend = null;      if (messageReadWrite)      {         p.flush();         arrayToSend = ostream.toByteArray();      }      else      {         arrayToSend = internalArray;      }      super.writeExternal(out);      if (arrayToSend == null)      {         out.writeInt(0); //pretend to be empty array      }      else      {         out.writeInt(arrayToSend.length);         out.write(arrayToSend);      }   }