public void finishWriting() {
    if (writeMode) {
      ignoreWrites = false;
      writeMode = false;
      buffer.flip();
      size += buffer.remaining();
    }
  }
Prepare the contents for sending again
geode-serialization/src/main/java/org/apache/geode/internal/serialization/BufferDataOutputStream.java