code: boolean stageData(final byte[] line) throws IOException
    {
      if (this._rowCount % 10000 == 0)
      {
        LOGGER.debug(
            "rowCount: {}, currentSize: {}", this._rowCount, _currentSize);
      }
      _outstream.write(line);
      _currentSize += line.length;
  
      _outstream.write(newLineBytes);
      this._rowCount++;
  
      if (_loader._testRemoteBadCSV)
      {
        // inject garbage for a negative test case
        // The file will be uploaded to the stage, but COPY command will
        // fail and raise LoaderError
        _outstream.write(new byte[]{(byte) 0x01, (byte) 0x02});
        _outstream.write(newLineBytes);
        this._rowCount++;
      }
  
      if (_currentSize >= this._csvFileSize)
      {
        LOGGER.debug("name: {}, currentSize: {}, Threshold: {},"
                     + " fileCount: {}, fileBucketSize: {}",
                     _file.getAbsolutePath(), _currentSize, this._csvFileSize, _fileCount,
                     this._csvFileBucketSize);
        _outstream.flush();
        _outstream.close();
        _outstream = null;
        FileUploader fu = new FileUploader(_loader, _location, _file);
        fu.upload();
        _uploaders.add(fu);
        openFile();
        _currentSize = 0;
      }
  
      return _fileCount > this._csvFileBucketSize;
    }
docs: not thread safe