protected Response streamResponse ( byte [ ] data , String type ) { try ( InputStream byteStream = new ByteArrayInputStream ( data ) ) { return streamResponse ( type , byteStream , data . length ) ; } catch ( IOException e ) { logger . error ( "Failed to stream data to client" , e ) ; return createInternalServerError ( "Failed to stream data to client" ) ; } }
Creates streamed response from byte array