private int canonalize(Object object) throws IOException {
    Integer id = writtenObjects.get(object);
    if (id != null) {
      return id;
    }
    String toString = object.toString();
    id = writtenStrings.get(toString);
    if (id != null) {
      return id;
    }

    id = nextInt++;

    outputStream.write(STRING_RECORD);
    outputStream.writeUTF(toString);

    writtenObjects.put(object, id);
    writtenStrings.put(toString, id);
    return id;
  }
Appends events logged using the SequenceLogger to a binary stream.
geode-core/src/main/java/org/apache/geode/internal/sequencelog/io/OutputStreamAppender.java