protected RequestEntity createBinaryRequestContent ( HTTPRequest httpRequest ) { RequestEntity requestEntity = null ; byte [ ] contentBinary = httpRequest . getContentAsBinary ( ) ; if ( contentBinary != null ) { requestEntity = new ByteArrayRequestEntity ( contentBinary , "binary/octet-stream" ) ; } return requestEntity ; }
This function creates a binary type request entity and populates it with the data from the provided HTTP request .