private byte[] getItemsAsBytes(List<? extends T> items) {

		StringBuilder lines = new StringBuilder();
		for (T item : items) {
			lines.append(lineAggregator.aggregate(item) + lineSeparator);
		}
		try {
			return lines.toString().getBytes(this.charset);
		}
		catch (UnsupportedEncodingException e) {
			throw new WriteFailedException("Could not write data.", e);
		}
	}
Converts the list of items to a byte array.

@param items the list
@return the byte array
spring-xd-hadoop/src/main/java/org/springframework/xd/batch/item/hadoop/SimpleHdfsTextItemWriter.java