Code example for ObjectOutput

Methods: writeLong, writeObject

0
   public static class Externalizer extends AbstractExternalizer<DldGlobalTransaction> { 
      private final GlobalTransaction.Externalizer delegate = new GlobalTransaction.Externalizer(new GlobalTransactionFactory(true));
 
      @Override 
      public void writeObject(ObjectOutput output, DldGlobalTransaction ddGt) throws IOException {
         delegate.writeObject(output, ddGt);
         output.writeLong(ddGt.getCoinToss());
         if (ddGt.locksAtOrigin.isEmpty()) {
            output.writeObject(null);
         } else { 
            output.writeObject(ddGt.locksAtOrigin);
         } 
      } 
 
      @Override 
      @SuppressWarnings("unchecked") 
      public DldGlobalTransaction readObject(ObjectInput input) throws IOException, ClassNotFoundException {
         DldGlobalTransaction ddGt = (DldGlobalTransaction) delegate.readObject(input);
         ddGt.setCoinToss(input.readLong());
         Object locksAtOriginObj = input.readObject();
         if (locksAtOriginObj == null) {