public static short readOrdinalFromInputStream(InputStream is) throws IOException {
    final int ordinal = is.read();
    if (ordinal != -1) {
      if (ordinal != KnownVersion.TOKEN_ORDINAL_INT) {
        return (short) ordinal;
      } else {
        // two byte ordinal
        final int ordinalPart1 = is.read();
        final int ordinalPart2 = is.read();
        if ((ordinalPart1 | ordinalPart2) >= 0) {
          return (short) ((ordinalPart1 << 8) | ordinalPart2);
        } else {
          return -1;
        }
      }
    } else {
      return -1;
    }
  }
Reads ordinal as written by {@link VersioningIO#writeOrdinal(ByteBuffer,short,boolean)} from
given {@link InputStream}. Returns -1 on
end of stream.
geode-serialization/src/main/java/org/apache/geode/internal/serialization/VersioningIO.java