private byte[] getPayloadAsBytes(Message<?> message) {
		byte[] bytes = null;
		Object payload = message.getPayload();
		if (payload instanceof byte[]) {
			bytes = (byte[]) payload;
		}
		else if (payload instanceof String) {
			try {
				bytes = ((String) payload).getBytes(this.charset);
			}
			catch (UnsupportedEncodingException e) {
				throw new MessageHandlingException(message, e);
			}
		}
		else {
			throw new MessageHandlingException(message,
					"HdfsTextFileWriter expects " +
							"either a byte array or String payload, but received: " + payload.getClass());
		}
		return bytes;
	}
Extracts the payload as a byte array.

@param message
@return payload
spring-xd-hadoop/src/main/java/org/springframework/xd/hadoop/fs/HdfsTextFileWriter.java