サーブレットなら、適切なContentType入れてやって
Content-Dispositionヘッダを設定して
バイナリをresponse.getOutputStreamで取得したstreamに書き込めばいい。