spring-projects/spring-xd — pull request #879 by garyrussell (2014-05-21 18:01:43+00:00)
Title: XD-1742 Support Binary in TCP and HTTP Sources

JIRA: https://jira.spring.io/browse/XD-1742

Previously, the TCP and HTTP sources unconditionally
converted byte[] to String.

Remove the transformer from the tcp source; now, if people
want String conversion, they would use

tcp --outputType=text/plain

Tested with

stream create --name foo --definition "tcp --decoder=RAW | file --binary=true " --deploy
stream create --name foo --definition "tcp --decoder=RAW --outputType=text/plain;charset=UTF-8 | file --binary=true " --deploy

Update the inbound http channel adapter to detect a
content-type of `application/octet-stream` and emit
a byte[] instead of performing String conversion.

This allows POSTing binary data...

curl --data-binary @foo.zip -H'content-type: application/octet-stream' http://localhost:9000

Add test case to verify. Also tested with

stream create --name bar --definition "http | file --binary=true " --deploy