/** * Writes a new record using the passed in array of values. * * @param values * Values to be written. * * @param preserveSpaces * Whether to preserver leading and trailing spaces in * columns while writing out to the record or not. * * @throws IOException * Thrown if an error occurs while writing data to the * destination stream. */ public void writeRecord(String[] values, boolean preserveSpaces) throws IOException { if (values != null && values.length > 0) { for (int i = 0; i < values.length; i++) { write(values[i], preserveSpaces); } endRecord(); } }