private void clearState() {
    writePos.clear();
    unsafeReadPos.clear();
  }
Compares the current readPosition of the buffer with the external byte array.
Does not modify readPoint.
serde/src/java/org/apache/hadoop/hive/serde2/WriteBuffers.java