@Override
	protected Object convertFromInternal(Message<?> message, Class<?> targetClass, Object conversionHint) {
		ByteArrayOutputStream bos = new ByteArrayOutputStream();
		try {
			new ObjectOutputStream(bos).writeObject(message.getPayload());
		}
		catch (IOException e) {
			logger.error(e.getMessage(), e);
			return null;
		}

		return buildConvertedMessage(bos.toByteArray(), message.getHeaders(),
				MessageConverterUtils.X_JAVA_SERIALIZED_OBJECT);
	}
A {@link org.springframework.messaging.converter.MessageConverter}
to convert from a POJO to byte[] with Java.io serialization if any.

@author David Turanski
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/integration/bus/converter/JavaToSerializedMessageConverter.java