code: private static final <T extends Appendable> void encodeRun(T buffer, int value, int length) {
          if (length < 4) {
              for (int j=0; j<length; ++j) {
                  if (value == ESCAPE) {
                      appendInt(buffer, value);
                  }
                  appendInt(buffer, value);
              }
          }
          else {
              if (length == ESCAPE) {
                  if (value == ESCAPE) {
                      appendInt(buffer, ESCAPE);
                  }
                  appendInt(buffer, value);
                  --length;
              }
              appendInt(buffer, ESCAPE);
              appendInt(buffer, length);
              appendInt(buffer, value); // Don't need to escape this value
          }
      }
docs: Encode a run, possibly a degenerate run (of < 4 values).
  @param length The length of the run; must be > 0 && <= 0xFFFF.