code: @Override
      public void close() throws WLFormatException {
  
          if (closed) {
              return;
          }
          closed = true;
          try {
              boolean[] layersRead = new boolean[super.layersInOrder.length];
              for (TextCorpusLayerTag layerRead : layersToRead) {
                  layersRead[layerRead.ordinal()] = true;
              }
  
              for (int i = 0; i < super.layersInOrder.length; i++) {
                  // if it's a newly added layer
                  if (super.layersInOrder[i] != null && !layersRead[i] //&& !super.layersInOrder[i].isEmpty() 
                          ) {
                      marshall(super.layersInOrder[i]);
                  }
              }
          } finally {
              xmlReaderWriter.readWriteToTheEnd();
          }
      }
docs: Closes the input and output streams associated with this object and
  releases any associated system resources. Before the streams are closed,
  all in-memory annotations of the <tt>TextCorpusStreamed</tt> and
  not-processed part of the input stream are written to the output stream.
  Therefore, it's important to call <tt>close()<tt> method, so that all the
  in-memory annotations are saved to the output stream. Once the
  <tt>TextCorpusStreamed</tt> has been closed, adding further annotations
  will have no effect on the output stream.
  
  @throws WLFormatException if an error in input format or an I/O error
  occurs.