Curl has already support the stream, try curl --help | grep binary and you will get:
"--data-binary DATA HTTP POST binary data (H)"
An example:
curl -v -XPOST http://example:port/path --data-binary @file.tar \
-H "Content-Type: application/octet-stream"