code: public static <T extends SequenceElement> void writeWordVectors(WeightLookupTable<T> lookupTable,
                                                                      OutputStream stream) throws IOException {
          val vocabCache = lookupTable.getVocabCache();
  
          try (PrintWriter writer = new PrintWriter(new OutputStreamWriter(stream, StandardCharsets.UTF_8))) {
              // saving header as "NUM_WORDS VECTOR_SIZE NUM_DOCS"
              val str = vocabCache.numWords() + " " + lookupTable.layerSize() + " " + vocabCache.totalNumberOfDocs();
              log.debug("Saving header: {}", str);
              writer.println(str);
  
              // saving vocab content
              val num = vocabCache.numWords();
              for (int x = 0; x < num; x++) {
                  T element = vocabCache.elementAtIndex(x);
  
                  val builder = new StringBuilder();
  
                  val l = element.getLabel();
                  builder.append(encodeB64(l)).append(" ");
                  val vec = lookupTable.vector(element.getLabel());
                  for (int i = 0; i < vec.length(); i++) {
                      builder.append(vec.getDouble(i));
                      if (i < vec.length() - 1)
                          builder.append(" ");
                  }
                  writer.println(builder.toString());
              }
          }
      }
docs: This method writes word vectors to the given OutputStream.
  Please note: this method doesn't load whole vocab/lookupTable into memory, so it's able to process large vocabularies served over network.
  
  @param lookupTable
  @param stream
  @param <T>
  @throws IOException