code: @Override
  	public void writeRecord(Record record) throws IOException {
  		int numRecFields = record.getNumFields();
  		int readPos;
  
  		for (int i = 0; i < this.numFields; i++) {
  			readPos = this.recordPositions[i];
  			if (readPos < numRecFields) {
  				Value v = record.getField(this.recordPositions[i], this.classes[i]);
  				if (v != null) {
  					if (i != 0) {
  						this.wrt.write(this.fieldDelimiter);
  					}
  					this.wrt.write(v.toString());
  				} else {
  					if (this.lenient) {
  						if (i != 0) {
  							this.wrt.write(this.fieldDelimiter);
  						}
  					} else {
  						throw new RuntimeException("Cannot serialize record with <null> value at position: " + readPos);
  					}
  				}
  
  			} else {
  				if (this.lenient) {
  					if (i != 0) {
  						this.wrt.write(this.fieldDelimiter);
  					}
  				} else {
  					throw new RuntimeException("Cannot serialize record with out field at position: " + readPos);
  				}
  			}
  
  		}
  
  		// add the record delimiter
  		this.wrt.write(this.recordDelimiter);
  	}
docs: --------------------------------------------------------------------------------------------