public static void writeOrdinal(ByteBuffer buffer, short ordinal, boolean compressed) {
    if (compressed && ordinal <= Byte.MAX_VALUE) {
      buffer.put((byte) ordinal);
    } else {
      buffer.put(KnownVersion.TOKEN_ORDINAL);
      buffer.putShort(ordinal);
    }
  }
Write the given ordinal (result of {@link Version#ordinal()}) to given
{@link ByteBuffer}. This keeps
the serialization of ordinal compatible with previous versions writing a single byte to
DataOutput when possible, and a token with 2 bytes if it is large.

@param buffer the {@link ByteBuffer} to write the ordinal write to
@param ordinal the version to be written
@param compressed if true, then use single byte for ordinal < 128, and three bytes for beyond
       that, else always use three bytes where the first byte is
       {@link KnownVersion#TOKEN_ORDINAL}
geode-serialization/src/main/java/org/apache/geode/internal/serialization/VersioningIO.java