docs: private void writeAllBufferedData()
          throws IOException
      {
          writeBytes(_user_output_stream);
  
          clearFieldName();
          clearAnnotations();
  
          _in_struct = false;
          _patch_count = 0;
          _patch_symbol_table_count = 0;
          _top = 0;
          try {
              _writer.setPosition(0);
              _writer.truncate();
          }
          catch (IOException e) {
              throw new IonException(e);
          }
      }