Good afternoon.
I have the next portion of code that is within a REST service.
String a = "0xFFD8FFE0.........";
//el valor de a es un dato tipo image de SQL Server
Blob blob2 = connection.createBlob();
blob2.setBytes(1, a.getBytes());
InputStream inputStream2 = blob2.getBinaryStream();
return Response.ok(inputStream2).build();
Result obtained: