code: public void saveAll(PGConnection connection, Stream<TEntity> entities) throws SQLException {
  
          try (PgBinaryWriter bw = new PgBinaryWriter(configuration.getBufferSize())) {
  
              // Wrap the CopyOutputStream in our own Writer:
              bw.open(new PGCopyOutputStream(connection, mapping.getCopyCommand(), 1));
  
              // Insert Each Column:
              entities.forEach(entity -> saveEntitySynchonized(bw, entity));
          }
      }
docs: Save stream of entities
  
  @param connection underlying db connection
  @param entities stream of entities
  @throws SQLException