KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to download a PDF file with HttpClient. I am able to get the file but i am not sure how to convert the bytes into a a PDF and store it somewhere on the system I have the following code, How can I store it as a PDF? public ???? getFile(String url) throws ClientProtocolException, IOException{ HttpGet httpget = new HttpGet(url); HttpResponse response = httpClient.execute(httpget); HttpEntity entity = response.getEntity(); if (entity != null) { long len = entity.getContentLength(); InputStream inputStream = entity.getContent(); // How do I write it? } return null; }
Tags (comma-separated)
Save Edits
Cancel