docs: public byte[] serializeChannel() throws IOException, InvalidArgumentException {
  
          if (isShutdown()) {
              throw new InvalidArgumentException(format("Channel %s has been shutdown.", getName()));
          }
  
          ObjectOutputStream out = null;
  
          try {
              ByteArrayOutputStream bai = new ByteArrayOutputStream();
              out = new ObjectOutputStream(bai);
              out.writeObject(this);
              out.flush();
              return bai.toByteArray();
          } finally {
              if (null != out) {
                  try {
                      out.close();
                  } catch (IOException e) {
                      logger.error(e); // best effort.
                  }
              }
          }
  
      }