You are getting a blob directly. Why not save the blob directly using resp.getBodyAsBlob()
String endPoint ='http://resources.docs.salesforce.com/rel1/doc/en-us/static/pdf/salesforce_query_search_optimization_developer_cheatsheet.pdf';
HTTP h = new HTTP();
HTTPRequest request = new HTTPRequest();
request.setEndpoint(endPoint);
request.setHeader('contentType', 'application/json');
request.setMethod('GET');
HTTPResponse resp = h.send(request);
if(resp.getStatusCode()==200){
Attachment attach = new Attachment();
attach.contentType = 'application/octet-stream';
attach.name = 'myfile111.pdf';
attach.parentId = '0010C000006ReQW';
attach.body = resp.getBodyAsBlob();
insert attach;
}
In my code, I am downloading a SF document PDF and saving it as an attachment on an account record