code: synchronized List<Write> close() {
          List<Write> items = new ArrayList<>(this.writes);
          this.writes.clear();
          this.totalLength = 0;
          this.closed = true;
          return items;
      }
docs: Clears the queue of all the items and closes it, preventing any new writes from being added.
  
  @return A new List with the contents of the queue (prior to cleanup), in the same order.