Code example for ObjectOutput

Methods: writeShort

   public ObjectOutput startObjectOutput(OutputStream os, boolean isReentrant) throws IOException {
      ObjectOutput out = defaultMarshaller.startObjectOutput(os, isReentrant);
      try { 
         if (trace) log.trace("Wrote version %s", VERSION_500);
      } catch (Exception e) {
         log.error("Unable to read version id from first two bytes of stream, barfing.");
         throw new IOException("Unable to read version id from first two bytes of stream : " + e.getMessage());
      return out;
   public void finishObjectOutput(ObjectOutput oo) {
   public void objectToObjectStream(Object obj, ObjectOutput out) throws IOException {
      /* No need to write version here. Clients should either be calling either: 
Contextual code suggestions in your IDE  Get Codota for Java