code: private void appendPortableReader(JMessage<?> message) {
          writer.appendln("@Override")
                .formatln("public void readPortable(%s %s) throws %s {",
                          PortableReader.class.getName(),
                          PORTABLE_READER,
                          IOException.class.getName())
                .begin();
          // TODO: This should be short[] instead, as field IDs are restricted to 16bit.
          writer.formatln("int[] field_ids = %s.readIntArray(\"__fields__\");", PORTABLE_READER)
                .appendln()
                .appendln("for (int id : field_ids) {")
                .begin()
                .appendln("switch (id) {")
                .begin();
          for (JField field : message.declaredOrderFields()) {
              writer.formatln("case %d: {", field.id())
                    .begin();
              readPortableField(field);
              writer.appendln("break;")
                    .end()
                    .appendln("}");
          }
          writer.end()
                .appendln("}") // switch
                .end()
                .appendln("}")  // for loop
                .end()
                .appendln("}") // readPortable
                .newline();
      }
docs: Method to append readPortable from hazelcast_portable.
  
  @param message JMessage with the information.
  <pre>
  {@code
  public void readPortable(com.hazelcast.nio.serialization.PortableReader portableReader) throws java.io.IOException {
  java.util.BitSet __temp_optionals = java.util.BitSet.valueOf(portableReader.readByteArray("__hzOptionalsForClassOptionalFields"));
  ...
  }
  }
  </pre>