public void reset() {
    buffer.clear();
    buffer.position(Connection.MSG_HEADER_BYTES);
  }
write the header after the message has been written to the stream
geode-core/src/main/java/org/apache/geode/internal/tcp/MsgOutputStream.java