public static Action bytesContent ( final byte [ ] content ) { return new Action ( response -> { response . setContentLength ( content . length ) ; try { response . getOutputStream ( ) . write ( content ) ; } catch ( IOException e ) { throw new RuntimeException ( "Can not write resource content for restito stubbing." ) ; } return response ; } ) ; }
Writes bytes content to response