posted 20 years ago
But 'binary format' usually implies it already encoded as an image, which can be stored as file. You need to specify what the source of this 'binary data' is, and what the destination format is.
For example, if the image is stored on the harddrive of the server and you want to send it to the client, get a binary OutputStream from the request, set the mimeType to "image/imagetype" (eg image/jpeg), and pipe one to the other.