Return an image from binary data in JAVA - Rest Service

0

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:

    
asked by Jesus Oviedo Riquelme 12.07.2017 в 23:13
source

0 answers