code: public static void writeClasses(ObjectOutput out, Class<?>[] types)
              throws java.io.IOException {
          int i;
  
          if (types.length > Byte.MAX_VALUE) {
              throw new RuntimeException("to many dimensions");
          }
          out.writeByte((byte) types.length);
          for (i = 0; i < types.length; i++) {
              write(out, types[i]);
          }
      }
docs: Writes an array of Class objects.
  @param  out    target to write to
  @param  types  Classes to be written